/* ==========================================================================
   1. VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
    --navy: #213a7e;
    --yellow: #eecf37;
    --cream: #f5e6c9;
    --white: #ffffff;
    --hover-gray: #f2f2f2;
    /* Aligns all containers with the brand margin */
    --inward-margin: calc(5% + 50px);
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--navy);
    background-color: var(--white);
    overflow-x: hidden;
}

/* ==========================================================================
   3. TYPOGRAPHY & GLOBAL SPACING
   ========================================================================== */
h1, h2, h3, 
.nav-links a, 
.dropdown-menu a, 
.mobile-nav a, 
.page-title {
    font-family: "neue-kabel", sans-serif;
}

h1 { 
    font-weight: 700; 
    /* text-transform: lowercase; */
    font-size: clamp(32px, 5vw, 48px); 
    line-height: 1.1; 
    margin-bottom: 30px; 
}

h2.sub-section-title {
    font-weight: 700;
    font-size: 28px;
    text-transform: lowercase;
    margin-top: -20px;
    margin-bottom: 20px; 
    line-height: 1.3;
}

p { 
    margin-bottom: 25px; 
    font-size: 18px; 
    line-height: 1.6; 
}

.lead { 
    font-size: 22px; 
    font-weight: 600; 
    color: var(--navy); 
}

/* Spacing fix: Target intro text when it follows H1 directly (Homepage) */
.page-title + .intro-text {
    margin-top: 60px; 
}

/* ==========================================================================
   4. ORGANIZING COMMITTEE GRID 
   ========================================================================== */
.committee-sections-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.committee-section {
    margin-bottom: 20px;
}

.section-header {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--cream);
    padding-bottom: 15px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 5px;
}

.email-link {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    text-decoration: none;
    color: var(--navy);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.email-link:hover { 
    opacity: 1; 
    color: var(--yellow); 
}

.committee-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 50px;
}

.person-card {
    display: flex;
    flex-direction: column;
}


.photo-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--cream);
    background-image: url('../../img/illustrations/tei-pattern-1.jpg'); 
    background-size: cover;
    background-position: center;
    display: block;
    object-fit: cover;
    margin-bottom: 15px;
}

.photo-placeholder1 {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--cream);
    background-image: url('../../img/illustrations/tei-pattern-1.jpg'); 
    background-size: cover;
    background-position: center;
    display: block;
    object-fit: cover;
    margin-bottom: 15px;
}

.photo-placeholder2 {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--cream);
    background-image: url('../../img/illustrations/tei-pattern-2.jpg'); 
    background-size: cover;
    background-position: center;
    display: block;
    object-fit: cover;
    margin-bottom: 15px;
}

.photo-placeholder3 {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--cream);
    background-image: url('../../img/illustrations/tei-pattern-3.jpg'); 
    background-size: cover;
    background-position: center;
    display: block;
    object-fit: cover;
    margin-bottom: 15px;
}

.person-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--navy);
}

.person-card p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--navy);
    opacity: 0.8;
}

/* ==========================================================================
   5. CONTENT BLOCKS & LISTS 
   ========================================================================== */
.content-section {
    margin-top: 80px;
}

.text-link {
    color: var(--navy);
    text-decoration: underline;
    text-decoration-color: var(--yellow);
    text-underline-offset: 4px;
}

.styled-list {
    list-style: none;
    margin: 25px 0;
}

.styled-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 18px;
}

.styled-list li::before {
    content: '•';
    color: var(--yellow);
    position: absolute;
    left: 0;
    font-size: 24px;
    line-height: 1;
}

/* ==========================================================================
   6. LASTING IMPACT AWARDS 
   ========================================================================== */
.awards-linear-list {
    margin-top: 10px;
    border-top: 1px solid var(--cream); 
}

.award-line-item {
    display: flex;
    padding: 40px 0;
    border-bottom: 1px solid var(--cream);
}

.award-line-item:last-child {
    border-bottom: none;
}

.award-year {
    font-family: "neue-kabel", sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--navy);
    width: 120px;
    flex-shrink: 0;
    opacity: 0.5;
}

.award-details {
    flex-grow: 1;
}

.award-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.award-title.italic {
    font-style: italic;
    font-weight: 500;
    opacity: 0.7;
}

.award-authors {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    margin-bottom: 15px;
    opacity: 0.8;
}

.view-paper-link {
    font-family: "neue-kabel", sans-serif;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--navy);
    text-decoration: none;
    border-bottom: 2px solid var(--yellow);
    padding-bottom: 2px;
}

/* ==========================================================================
   7. HISTORY TABLE
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    margin-top: 30px;
}

/* Simple: ensure sponsor tier table triggers horizontal scroll when container is narrower */
.table-responsive .sponsor-tier-table {
    min-width: 900px !important;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
}

.history-table th {
    font-family: "neue-kabel", sans-serif;
    text-align: left;
    background-color: var(--white);
    color: var(--navy);
    padding: 15px;
    font-weight: 700;
    border-bottom: 2px solid var(--yellow);
}

.history-table td {
    padding: 15px;
    border-bottom: 1px solid var(--cream);
    font-size: 15px;
}

.history-table tr:hover {
    background-color: var(--hover-gray);
}

.history-table a {
    color: var(--navy);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--yellow); 
    text-underline-offset: 4px; 
    transition: opacity 0.2s;
}

.history-table td a {
    color: var(--navy);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--yellow); 
    text-underline-offset: 4px; 
    transition: opacity 0.2s;
}

.history-table td a:hover {
    opacity: 0.7;
}

.history-table .center {
    text-align: center;
}

/* ======================================================================
   8. BECOME A SPONSOR
   ====================================================================== */
.sponsor-page-container {
    max-width: 1800px;
    padding: 0 clamp(20px, 2vw, 40px);
}

.sponsor-info-table td:first-child {
    width: 260px;
}

.sponsor-tier-table {
    width: auto; /* allow natural width so min-width can trigger scrolling */
    table-layout: auto;
}

.sponsor-tier-table th,
.sponsor-tier-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.sponsor-tier-table th:not(:first-child),
.sponsor-tier-table td:not(:first-child) {
    text-align: center;
}

/* ==========================================================================
   9. STEERING COMMITTEE GRID
   ========================================================================== */
.steering-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 40px;
    margin-top: 0;
}

.steering-item {
    font-size: 16px;    
    padding-bottom: 10px; 
    line-height: 1.4;
}

/* Deskop-only Steering Borders: moved to Section 14 responsive queries */


/* ==========================================================================
   9. DESKTOP HEADER & NAVIGATION 
   ========================================================================== */
header, #site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px var(--inward-margin);
    background: var(--white);
    position: relative;
    z-index: 1000;
    height: 130px;
}

.logo-link img {
    height: 80px;
    width: auto;
    display: block;
}

.desktop-nav {
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: baseline;
}

.nav-links > li {
    position: relative;
    padding: 15px 0;
}

.nav-links > li > a {
    text-decoration: none;
    color: var(--navy);
    font-weight: 500;
    font-size: 20px;
    position: relative;
}

.nav-links > li > a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 6px;
    background-color: var(--yellow);
}

/* ==========================================================================
   10. DESKTOP DROPDOWN MENUS 
   ========================================================================== */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border: 1px solid var(--yellow);
    min-width: 240px;
    list-style: none;
    padding: 0;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.08);
}

.dropdown-menu li a {
    display: block;
    padding: 12px 25px;
    text-decoration: none;
    color: var(--navy);
    font-size: 19px;
    font-weight: 500;
}

.dropdown-menu li a:hover {
    background-color: var(--hover-gray);
}

.dropdown-menu li a span {
    position: relative;
    display: inline-block;
}

.dropdown-menu li a:hover span::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background-color: var(--yellow);
}

.nav-links li:hover .dropdown-menu {
    display: block;
}

/* ==========================================================================
   11. MOBILE OVERLAY 
   ========================================================================== */
.mobile-toggle-open {
    display: none;
    background: none;
    border: none;
    font-size: 40px;
    color: var(--navy);
    cursor: pointer;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    border-bottom: 4px solid var(--yellow); 

    /* FAST FADE TRANSITION */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s;
    height: auto;
    max-height: 100vh;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px var(--inward-margin);
    height: 130px;
    flex-shrink: 0;
}

.mobile-logo {
    height: 80px;
    width: auto;
}

.mobile-toggle-close {
    background: none;
    border: none;
    font-size: 35px;
    color: var(--navy);
    cursor: pointer;
}

.mobile-nav {
    padding: 0 var(--inward-margin) 40px var(--inward-margin);
    overflow-y: auto;
}

.mobile-main-list {
    list-style: none;
}

.mobile-main-list > li {
    border-bottom: 1px solid var(--cream);
}

.mobile-main-list > li:last-child {
    border-bottom: none;
}

.mobile-link-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
}

.mobile-main-list a {
    text-decoration: none;
    color: var(--navy);
    font-size: 20px;
    font-weight: 500;
}

.mobile-arrow {
    font-size: 30px;
    font-weight: 500;
    transition: transform 0.3s ease;
    pointer-events: none;
}

/* Accordion Open States */
.mobile-has-submenu.open .mobile-submenu {
    max-height: 600px;
    margin-bottom: 20px;
    opacity: 1;
}

.mobile-has-submenu.open .mobile-arrow {
    transform: rotate(45deg);
    color: var(--yellow);
}

.mobile-submenu {
    list-style: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.2s ease;
    padding-left: 15px;
}

.mobile-submenu li {
    padding: 8px 0;
}

.mobile-submenu a {
    font-size: 18px;
    opacity: 0.8;
}

/* --- Sticky Mobile Header --- */

/* Base Styles (Defined once at root level) */
.sticky-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px; /* Bigger for more white space as requested */
    background-color: var(--white);
    display: none; /* Hidden on desktop */
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--inward-margin); /* Keeps logo aligned with body text margin */
    z-index: 1500;
    border-bottom: 2px solid var(--yellow); /* Yellow stroke */
    
    /* Animation state: hidden by default */
    opacity: 0;
    transform: translateY(-100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

/* Visibility class triggered by JS scroll */
.sticky-mobile-header.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Logo size in the sticky bar */
.sticky-logo img {
    height: 44px; /* Horizontal logo size */
    width: auto;
    display: block;
}

/* --- OVERLAY HEADER (For alignment when opened) --- */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--inward-margin);
    height: 130px; /* Matches main site header height */
    flex-shrink: 0;
}

/* Ensures the 'X' and the sticky '+' align perfectly */
.mobile-toggle-close {
    background: none;
    border: none;
    font-size: 35px; 
    color: var(--navy);
    cursor: pointer;
    line-height: 1;
}



/* ==========================================================================
   12. HERO & MAIN CONTAINERS 
   ========================================================================== */
.hero {
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block !important;
}

.home-hero {
    height: clamp(420px, 52vh, 760px);
    min-height: clamp(420px, 52vh, 760px);
}

.sub-hero {
    height: 140px;
    min-height: 140px;
}

.container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 var(--inward-margin);
}




/* ==========================================================================
   13. FOOTER & SOCIALS
   ========================================================================== */
footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; 
    padding: 45px calc(var(--inward-margin) + 20px);
    border-top: 1px solid var(--yellow);
    margin-top: 100px;
    background-color: var(--white);
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-left { gap: 5px; }
.footer-logo img { height: 30px; width: auto; }

.footer-text-block p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--navy);
}

.footer-location { font-weight: 600; }

/* --- CENTER COLUMN: Supporting Partners --- */
.footer-center { align-items: flex-start; }

.footer-center .social-label {
    font-family: "neue-kabel", sans-serif;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px; 
    text-transform: lowercase;
    color: var(--navy);
}

.partners-container {
    display: flex;
    gap: 20px;
    align-items: center; 
}

/* Updated selectors to account for the new <a> tags */
.partners-container a {
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.partners-container a:hover {
    opacity: 0.7;
}

/* Sizing logic to balance the two logos */
.partners-container a:first-child .partner-logo {
    height: 48px; /* ACM Logo */
    width: auto;
}

.partners-container a:last-child .partner-logo {
    height: 30px; /* SIGCHI Logo */
    width: auto;
}

/* --- RIGHT COLUMN: Socials & Copyright --- */
.footer-right { align-items: flex-end; gap: 8px; }

.social-container { display: flex; gap: 18px; margin-bottom: 0; }

.social-container img {
    width: 22px;
    height: 22px;
    filter: invert(21%) sepia(30%) saturate(3542%) hue-rotate(208deg) brightness(91%) contrast(92%);
    transition: opacity 0.2s;
}

.social-container a:hover img { opacity: 0.6; }

.footer-copyright {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--navy);
    opacity: 0.8;
}


/* ==========================================================================
   14. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Mobile small: <=600px */
@media (max-width: 600px) {
    :root { --inward-margin: 5%; }

    header, footer, .container, .mobile-header, .mobile-nav, #site-header {
        padding-left: var(--inward-margin);
        padding-right: var(--inward-margin);
    }

    .desktop-nav { display: none; }

    .mobile-toggle-open, #open-menu-sticky, .mobile-toggle-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 40px;
        line-height: 1;
        padding: 0;
        background: none;
        border: none;
    }

    .committee-grid { grid-template-columns: 1fr; gap: 18px; }

    /* Make organizing photos much smaller on small mobile screens */
    .person-card {
        align-items: center;
        text-align: center;
    }

    .photo-placeholder,
    .photo-placeholder1,
    .photo-placeholder2,
    .photo-placeholder3 {
        width: min(140px, 60%);
        max-width: 140px;
        aspect-ratio: 1 / 1;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 12px;
        display: block;
        object-fit: cover;
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 9999;
        background: var(--white);
    }

    /* Compact footer: stack columns, reduce padding for mobile */
    footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 30px var(--inward-margin);
        gap: 18px;
    }
    .footer-right {
        align-items: flex-start;
    }
    .partners-container {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* Mobile large: 601px - 767px */
@media (min-width: 601px) and (max-width: 767px) {
    :root { --inward-margin: 5%; }

    header, footer, .container, .mobile-header, .mobile-nav, #site-header {
        padding-left: var(--inward-margin);
        padding-right: var(--inward-margin);
    }

    .desktop-nav { display: none; }

    .mobile-toggle-open, #open-menu-sticky, .mobile-toggle-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 40px;
        line-height: 1;
        padding: 0;
        background: none;
        border: none;
    }

    .committee-grid { grid-template-columns: 1fr; gap: 20px; }

    /* Slightly larger but still compact on small tablets / large phones */
    .person-card {
        align-items: center;
        text-align: center;
    }

    .photo-placeholder,
    .photo-placeholder1,
    .photo-placeholder2,
    .photo-placeholder3 {
        width: min(160px, 55%);
        max-width: 160px;
        aspect-ratio: 1 / 1;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 14px;
        display: block;
        object-fit: cover;
    }
}

/* Tablet: 400px - 1023px */
@media (min-width: 400px) and (max-width: 1023px) {
    :root { --inward-margin: 5%; }

    header, footer, .container, .mobile-header, .mobile-nav, #site-header {
        padding-left: var(--inward-margin);
        padding-right: var(--inward-margin);
    }

    .desktop-nav { display: none; }

    .mobile-toggle-open, #open-menu-sticky, .mobile-toggle-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 40px;
        line-height: 1;
        padding: 0;
        background: none;
        border: none;
    }

    .committee-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }

    /* Tablet: show smaller profile photos centered within each card (start at 400px) */
    .person-card {
        align-items: center;
        text-align: center;
    }

    .photo-placeholder,
    .photo-placeholder1,
    .photo-placeholder2,
    .photo-placeholder3 {
        /* reduce size a bit more for tablet and smaller screens */
        width: min(160px, 50%);
        max-width: 160px;
        aspect-ratio: 1 / 1;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 12px;
        display: block;
        object-fit: cover;
    }
}

/* Ensure hero background shows the full image on the homepage only (tablet and mobile) */
@media (max-width: 1023px) {
    .home-hero {
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }
}

/* Place partners under the first footer column for tablet (601px - 1023px) */
@media (min-width: 601px) and (max-width: 1023px) {
    footer {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: min-content min-content;
        gap: 18px 24px;
        align-items: start;
        padding: 30px var(--inward-margin);
    }

    /* Left column and partners sit in the first grid column */
    .footer-left { grid-column: 1; grid-row: 1; }
    .footer-center { grid-column: 1; grid-row: 2; margin-top: 8px; }

    /* Keep socials / copyright in the second column, left-aligned like the first column */
    .footer-right {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        justify-self: start;
        align-items: flex-start;
    }

    .partners-container {
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 8px;
        justify-content: flex-start;
    }

    .partners-container a { justify-content: flex-start; }
}


/* Desktop: >=1024px (desktop nav) */
@media (min-width: 1024px) {
    header, footer, .container, .mobile-header, .mobile-nav, #site-header {
        padding-left: var(--inward-margin);
        padding-right: var(--inward-margin);
    }

    .desktop-nav { display: block; }

    .mobile-toggle-open, #open-menu-sticky { display: none; }

    .committee-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }

    /* Desktop-only steering borders */
    .steering-grid {
        grid-template-columns: repeat 1fr;
        gap: 0 40px;
    }

    .steering-item {
        border-right: 1px solid var(--cream);
        padding-right: 20px;
    }

    .steering-item:last-child {
        border-right: none;
        padding-right: 0;
    }
}

/* Larger screens: >=2200px */
@media (min-width: 2200px) {
    .home-hero { height: clamp(520px, 58vh, 920px); min-height: clamp(520px, 58vh, 920px); }
    .committee-grid { grid-template-columns: repeat(4, 1fr); gap: 50px; }
}

/* Become a Sponsor: large desktop fit */
@media (min-width: 1280px) {
    .sponsor-tier-table {
        table-layout: fixed;
        width: 100%;
    }

    .sponsor-tier-table th:first-child,
    .sponsor-tier-table td:first-child {
        width: 32%;
    }

    .sponsor-tier-table th:not(:first-child),
    .sponsor-tier-table td:not(:first-child) {
        width: 13.6%;
    }

    .sponsor-tier-table th,
    .sponsor-tier-table td {
        overflow-wrap: normal;
        word-break: normal;
    }
}

/* Become a Sponsor: tablets and small laptops */
@media (min-width: 768px) and (max-width: 1279px) {
    .sponsor-page-container {
        padding: 0 var(--inward-margin);
    }

    .sponsor-tier-table th,
    .sponsor-tier-table td {
        padding: 12px 10px;
        font-size: 14px;
    }
}

/* Become a Sponsor: mobile */
@media (max-width: 767px) {
    .sponsor-page-container {
        padding: 0 var(--inward-margin);
    }

    .sponsor-info-table td:first-child {
        width: 38%;
    }

    .sponsor-tier-table th,
    .sponsor-tier-table td {
        padding: 10px 8px;
        font-size: 13px;
        line-height: 1.35;
    }
}

/* Force a horizontal scroll on medium and small viewports when table cannot fit */
@media (max-width: 1279px) {
    .table-responsive .sponsor-tier-table {
        min-width: 900px; /* earlier scrollbar trigger */
    }
}

/* Ensure sponsor table is responsive on small/medium screens: allow wrapping and horizontal scroll when necessary */
@media (max-width: 1023px) {
    .table-responsive .sponsor-tier-table {
        width: auto;
        min-width: 100%;
        table-layout: auto;
    }

    .sponsor-tier-table th,
    .sponsor-tier-table td {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* Make sponsor tier table behave like the history table on small screens:
   prefer horizontal scrolling rather than compressing columns. */
@media (max-width: 1023px) {
    /* Allow all columns to wrap smoothly on small screens; rely on .table-responsive for scrolling
       Table will still use min-width on medium screens to trigger horizontal scrolling earlier. */
    .table-responsive .sponsor-tier-table th,
    .table-responsive .sponsor-tier-table td {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* Clamp the first column to max 3 lines on small screens to avoid extreme row height */
@media (max-width: 1023px) {
    /* Allow the benefits column to wrap naturally (no forced clamp) so text flows smoothly */
    .table-responsive .sponsor-tier-table th:first-child,
    .table-responsive .sponsor-tier-table td:first-child {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}