/* ============================
   AAI Table Styles — Professional
   Primary: #184724 (Forest Green)
   ============================ */

:root {
    --aai-primary:       #184724;
    --aai-primary-dark:  #0f2e17;
    --aai-primary-light: #e8f5ea;
    --aai-primary-mid:   #276336;
    --aai-accent:        #f0a500;
    --aai-text:          #1a1a1a;
    --aai-muted:         #555;
    --aai-border:        #d4e6d6;
    --aai-row-even:      #f4faf5;
    --aai-row-hover:     #ddf0e2;
    --aai-shadow:        rgba(24, 71, 36, 0.12);
}

/* Font */
body,
.table-container,
.caproom {
    font-family: 'Kanit', sans-serif;
}

/* Container */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--aai-shadow);
    background: #fff;
    border: 1px solid var(--aai-border);
}

/* Base table */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 700px;
    table-layout: fixed;
}

/* Caption */
caption {
    caption-side: top;
    padding: 20px 20px 8px;
    font-size: 1.15em;
    font-weight: 700;
    color: var(--aai-primary-dark);
    text-align: center;
    line-height: 1.6;
    background: var(--aai-primary-light);
    border-bottom: 2px solid var(--aai-border);
}

.caproom {
    display: block;
    font-size: 0.82em;
    font-weight: 400;
    color: var(--aai-muted);
    margin-top: 4px;
    font-style: italic;
}

/* Cell base */
td,
th {
    padding: 13px 16px;
    border-bottom: 1px solid var(--aai-border);
    vertical-align: middle;
    font-size: 0.93em;
    line-height: 1.6;
}

/* Header rows */
th {
    background: linear-gradient(135deg, var(--aai-primary) 0%, var(--aai-primary-mid) 100%);
    color: #fff;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
    border-bottom: 2px solid var(--aai-primary-dark);
    white-space: nowrap;
}

/* First th row — top rounded corners */
thead tr:first-child th:first-child,
tr:first-child th:first-child {
    border-top-left-radius: 0;
}
thead tr:first-child th:last-child,
tr:first-child th:last-child {
    border-top-right-radius: 0;
}

/* Striped rows */
tr:nth-child(even) td {
    background-color: var(--aai-row-even);
}
tr:nth-child(odd) td {
    background-color: #fff;
}

/* Hover highlight */
tr.open-gallery:hover td,
tr:not(:has(th)):hover td {
    background-color: var(--aai-row-hover);
    cursor: pointer;
    transition: background-color 0.18s ease;
}

/* Clickable gallery row indicator */
tr.open-gallery td {
    position: relative;
}
tr.open-gallery td:first-child::before {
    content: '🖼';
    font-size: 11px;
    position: absolute;
    top: 4px;
    left: 4px;
    opacity: 0.5;
}
tr.open-gallery:hover td:first-child::before {
    opacity: 1;
}

/* Vertical dividers between columns */
td:not(:last-child),
th:not(:last-child) {
    border-right: 1px solid var(--aai-border);
}

/* Last column notes */
td:last-child {
    color: var(--aai-muted);
    font-size: 0.88em;
    line-height: 1.65;
}

/* Footer note rows (th inside tbody) */
tbody tr th {
    background: var(--aai-primary-light);
    color: var(--aai-primary-dark);
    font-size: 0.88em;
    font-weight: 500;
    text-align: left;
    border-top: 2px solid var(--aai-border);
}

/* Center numeric columns */
td:nth-child(2),
td:nth-child(3),
td:nth-child(4) {
    text-align: center;
    font-weight: 500;
    color: var(--aai-primary-dark);
}

/* Hidden gallery links */
.hidden-gallery {
    display: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    td, th {
        padding: 10px 12px;
        font-size: 0.88em;
    }
    caption {
        font-size: 1.0em;
        padding: 14px 14px 6px;
    }
}

@media (max-width: 480px) {
    td, th {
        padding: 8px 10px;
        font-size: 0.83em;
    }
    caption {
        font-size: 0.95em;
    }
}

/* Column widths — room1 */
.room1-table col:nth-child(1) { width: 18%; }
.room1-table col:nth-child(2) { width: 9%; }
.room1-table col:nth-child(3) { width: 14%; }
.room1-table col:nth-child(4) { width: 9%; }
.room1-table col:nth-child(5) { width: 50%; }