/* ILS Tables Styles */

:root {
    --ils-price-header-bg: rgb(38, 62, 120);
    --ils-price-header-border: rgb(38, 62, 120);

    --ils-schedule-header-bg: rgb(0, 152, 155);
    --ils-schedule-header-border: rgb(0, 152, 155);

    --ils-season-header-bg: rgb(195, 81, 47);
    --ils-season-header-border: rgb(195, 81, 47);

    --ils-course-overview-header-bg: rgb(142, 0, 83);
    --ils-course-overview-header-border: rgb(142, 0, 83);

    --ils-course-dates-header-bg: rgb(195, 81, 47);
    --ils-course-dates-header-border: rgb(195, 81, 47);

    --ils-font-family: "Open Sans", Helvetica, Arial, sans-serif;
    --ils-header-color: #fff;
    --ils-body-border: rgb(225, 225, 225);
    --ils-even-row-bg: #f2f2f2;

    /* Fluid base font size for all ILS tables (vw-based, so no breakpoints).
       Two lines combined with min(), clamped to [8px, 14px]:
       - 10px + 4 * (100vw - 400px) / 880: gentle 10px -> 14px across 400-1280px
       - (100vw - 135px) / 30: governs below ~440px; shrinks the font as far as
         needed for the widest table (price, 6 columns) to fit without mid-word
         wraps. 135px ~= cell padding + borders + page padding; 30 ~= the widest
         column set per 1px of font, with ~10% margin - conservative now that
         headers share the body size and Dauer breaks at the slash.
       Below ~375px the 8px floor binds and overflow-wrap takes over. */
    --ils-font-size: clamp(8px, min(calc(10px + 4 * (100vw - 400px) / 880), calc((100vw - 135px) / 30)), 14px);
}

.ils-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: var(--ils-font-size);
}

.ils-table thead th {
    padding: 8px 12px;
    line-height: 1.45;
    font-size: 1em;
    font-family: var(--ils-font-family);
    font-weight: 700;
    color: var(--ils-header-color);
    text-align: left;
}

/* Price table header */
.ils-price-table thead th {
    background-color: var(--ils-price-header-bg);
    border-color: var(--ils-price-header-border);
}

/* Schedule table header */
.ils-schedule-table thead th {
    background-color: var(--ils-schedule-header-bg);
    border-color: var(--ils-schedule-header-border);
}

/* Season dates table header */
.ils-season-table thead th {
    background-color: var(--ils-season-header-bg);
    border-color: var(--ils-season-header-border);
}

/* Course overview table header */
.ils-course-overview-table thead th {
    background-color: var(--ils-course-overview-header-bg);
    border-color: var(--ils-course-overview-header-border);
}

/* Course dates table header */
.ils-course-dates-table thead th {
    background-color: var(--ils-course-dates-header-bg);
    border-color: var(--ils-course-dates-header-border);
}

/* Body rows */
.ils-table tbody td {
    font-size: 1em;
    padding: 8px 12px;
    line-height: 1.55;
    font-family: var(--ils-font-family);
    font-weight: 400;
    border-color: var(--ils-body-border);
}

/* Zebra striping - schedule table uses per-type tbody groups */
.ils-schedule-table tbody:nth-of-type(even) td {
    background-color: var(--ils-even-row-bg);
}

/* All other tables: individual row striping */
.ils-table:not(.ils-schedule-table) > tbody > tr:nth-child(even) {
    background-color: var(--ils-even-row-bg);
}

/* Course type name in schedule table (rowspan cell) */
.ils-type-name {
    font-weight: 700;
    vertical-align: middle;
}

/* Price table Dauer suffix: unbreakable, so the cell can only wrap at the
   <wbr> placed before it ("12 Wochen" / "/Subniveau"), never inside it. */
.ils-nowrap {
    white-space: nowrap;
}

/* Pause footnote */
.ils-pause-note {
    margin-top: 0.5em;
    font-size: 0.85em;
    color: #666;
}

/* Duration note (used by season-dates and course-dates) */
.ils-duration-note {
    margin-top: 0.5em;
    font-size: 0.9em;
    color: #666;
}

/* Responsive: font sizes scale fluidly via --ils-font-size; only padding tightens here */
@media (max-width: 640px) {
    .ils-table thead th {
        padding: 6px 8px;
    }
    .ils-table tbody td {
        padding: 4px 8px;
    }
}

/* Fit-line regime (<=440px): tighten padding along with the font */
@media (max-width: 440px) {
    .ils-table thead th {
        padding: 4px 6px;
    }
    .ils-table tbody td {
        padding: 3px 6px;
    }
}

/* Style overrides */
.ils-table th {
    font-weight: 500 !important;
    /* Themes may pin th font-size; !important keeps headers on the fluid scale */
    font-size: 1em !important;
}

.ils-table td {
    border: 1px solid rgb(225, 225, 225);
}

.ils-table td:not(:first-child),
.ils-table th,
.ils-schedule-table tbody tr:not(:first-child) td {
    text-align: center !important;
}

.ils-table td,
.ils-table th {
    color: rgb(61, 61, 61);
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    /* Let long words wrap so the table can always shrink to its container.
       'anywhere' (unlike 'break-word') also lowers the intrinsic min-content
       width used by auto table layout. hyphens: auto needs the page lang. */
    overflow-wrap: anywhere;
    -webkit-hyphens: auto;
    hyphens: auto;
}