/* ============================================
   Text Section Styles
   ============================================ */

/* Base Section Styles */
.text-section {
    width: 100%;
    position: relative;
}

/* Container */
.text-section__container {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Content Wrapper */
.text-section__content {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Width Variants
   ============================================ */

.text-section--narrow .text-section__content {
    max-width: 720px;
}

.text-section--medium .text-section__content {
    max-width: 960px;
}

.text-section--wide .text-section__content {
    max-width: 1200px;
}

.text-section--full .text-section__content {
    max-width: 100%;
}

/* ============================================
   Alignment Variants
   ============================================ */

.text-section--align-left .text-section__content {
    text-align: left;
}

.text-section--align-center .text-section__content {
    text-align: center;
}

.text-section--align-right .text-section__content {
    text-align: right;
}

/* ============================================
   Padding Variants
   ============================================ */

/* Top Padding */
.text-section--padding-top-none {
    padding-top: 0;
}

.text-section--padding-top-small {
    padding-top: 2rem;
}

.text-section--padding-top-medium {
    padding-top: 4rem;
}

.text-section--padding-top-large {
    padding-top: 6rem;
}

/* Bottom Padding */
.text-section--padding-bottom-none {
    padding-bottom: 0;
}

.text-section--padding-bottom-small {
    padding-bottom: 2rem;
}

.text-section--padding-bottom-medium {
    padding-bottom: 4rem;
}

.text-section--padding-bottom-large {
    padding-bottom: 6rem;
}

/* ============================================
   Background Color Variants
   ============================================ */

.text-section--bg-white {
    background-color: var(--color-white, #ffffff);
}

.text-section--bg-light-gray {
    background-color: var(--color-light-gray, #f5f5f5);
}

.text-section--bg-primary {
    background-color: var(--color-primary, #0066cc);
    color: var(--color-white, #ffffff);
}

.text-section--bg-dark {
    background-color: var(--color-dark, #1a1a1a);
    color: var(--color-white, #ffffff);
}

/* ============================================
   Content Typography
   ============================================ */

.text-section__content h1,
.text-section__content h2,
.text-section__content h3,
.text-section__content h4,
.text-section__content h5,
.text-section__content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    font-weight: 600;
}

.text-section__content h1:first-child,
.text-section__content h2:first-child,
.text-section__content h3:first-child,
.text-section__content h4:first-child,
.text-section__content h5:first-child,
.text-section__content h6:first-child {
    margin-top: 0;
}

.text-section__content h1 {
    font-size: 2.5rem;
}

.text-section__content h2 {
    font-size: 2rem;
}

.text-section__content h3 {
    font-size: 1.75rem;
}

.text-section__content h4 {
    font-size: 1.5rem;
}

.text-section__content h5 {
    font-size: 1.25rem;
}

.text-section__content h6 {
    font-size: 1rem;
}

.text-section__content p {
    margin-bottom: 1.25em;
    line-height: 1.7;
}

.text-section__content p:last-child {
    margin-bottom: 0;
}

.text-section__content ul,
.text-section__content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.text-section__content li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.text-section__content a {
    color: var(--color-primary, #0066cc);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.text-section__content a:hover {
    color: var(--color-primary-dark, #004999);
}

/* Links in dark backgrounds */
.text-section--bg-primary .text-section__content a,
.text-section--bg-dark .text-section__content a {
    color: var(--color-white, #ffffff);
    text-decoration-color: rgba(255, 255, 255, 0.5);
}

.text-section--bg-primary .text-section__content a:hover,
.text-section--bg-dark .text-section__content a:hover {
    text-decoration-color: var(--color-white, #ffffff);
}

.text-section__content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid var(--color-primary, #0066cc);
    background-color: var(--color-light-gray, #f5f5f5);
    font-style: italic;
}

.text-section--bg-primary .text-section__content blockquote,
.text-section--bg-dark .text-section__content blockquote {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--color-white, #ffffff);
}

.text-section__content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
}

.text-section__content figure {
    margin: 1.5em 0;
}

.text-section__content figcaption {
    margin-top: 0.5em;
    font-size: 0.875rem;
    color: var(--color-gray, #666666);
    text-align: center;
}

.text-section__content table {
    width: 100%;
    margin-bottom: 1.5em;
    border-collapse: collapse;
}

.text-section__content th,
.text-section__content td {
    padding: 0.75em;
    border: 1px solid var(--color-border, #dddddd);
    text-align: left;
}

.text-section__content th {
    background-color: var(--color-light-gray, #f5f5f5);
    font-weight: 600;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .text-section__container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .text-section--padding-top-small {
        padding-top: 1.5rem;
    }

    .text-section--padding-top-medium {
        padding-top: 3rem;
    }

    .text-section--padding-top-large {
        padding-top: 4rem;
    }

    .text-section--padding-bottom-small {
        padding-bottom: 1.5rem;
    }

    .text-section--padding-bottom-medium {
        padding-bottom: 3rem;
    }

    .text-section--padding-bottom-large {
        padding-bottom: 4rem;
    }

    .text-section__content h1 {
        font-size: 2rem;
    }

    .text-section__content h2 {
        font-size: 1.75rem;
    }

    .text-section__content h3 {
        font-size: 1.5rem;
    }

    .text-section__content h4 {
        font-size: 1.25rem;
    }

    .text-section__content ul,
    .text-section__content ol {
        padding-left: 1.5em;
    }

    .text-section__content blockquote {
        padding: 0.75em 1em;
        margin: 1em 0;
    }
}

@media (max-width: 480px) {
    .text-section--padding-top-medium {
        padding-top: 2rem;
    }

    .text-section--padding-top-large {
        padding-top: 3rem;
    }

    .text-section--padding-bottom-medium {
        padding-bottom: 2rem;
    }

    .text-section--padding-bottom-large {
        padding-bottom: 3rem;
    }

    .text-section__content h1 {
        font-size: 1.75rem;
    }

    .text-section__content h2 {
        font-size: 1.5rem;
    }
}
