/* Styles for CMS page blocks (views/blocks/*.php). Matches the original hand-built pages. */

.cms-blocks > * + * { margin-top: 6rem; }
.cms-p { font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.2rem; }
.cms-p:last-child { margin-bottom: 0; }
.cms-bullets { list-style: none; margin: 0 0 1.3rem; padding: 0; display: grid; gap: 0.7rem; }
.cms-bullets:last-child { margin-bottom: 0; }
.cms-bullets li { position: relative; padding-left: 2rem; font-size: 1.05rem; line-height: 1.65; }
.cms-bullets li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 0; top: 0.2em; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: rgba(251, 191, 36, 0.2); color: #b45309; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; }
.cms-section-head { text-align: center; max-width: 900px; margin: 0 auto 3.5rem; }
.cms-section-head h2 { font-size: 2.5rem; color: var(--color-primary); margin-bottom: 1rem; font-weight: 700; line-height: 1.2; text-wrap: balance; }
.cms-section-head .u-nowrap { white-space: nowrap; }
.cms-section-head p { font-size: 1.1rem; color: var(--color-text-light); line-height: 1.7; }

/* intro */
.cms-intro { text-align: center; max-width: 900px; margin-left: auto; margin-right: auto; }
.cms-intro .accent-bar { width: 60px; height: 3px; background-color: var(--color-accent); margin: 0 auto 2rem; border-radius: 2px; }
.cms-intro h2 { font-size: 2.5rem; color: var(--color-primary); margin-bottom: 1.5rem; font-weight: 700; }
.cms-intro .lead { font-size: 1.4rem; font-weight: 600; line-height: 1.7; color: var(--color-primary); margin-bottom: 1.5rem; }
.cms-intro .cms-p { font-size: 1.15rem; line-height: 1.8; }

/* image_text */
.cms-image-text { display: flex; flex-wrap: wrap; gap: 4rem; align-items: center; }
.cms-image-text.image-right { flex-direction: row-reverse; }
.cms-image-text > div { flex: 1; min-width: 300px; }
.cms-image-text img { width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); }
.cms-image-text h2 { font-size: 2.2rem; color: var(--color-primary); margin-bottom: 0.5rem; }
.cms-image-text h3 { font-size: 1.8rem; color: var(--color-text); font-weight: 400; margin-bottom: 1.5rem; }
.cms-image-text h2.solo { margin-bottom: 1.5rem; }
.cms-it-gallery { display: flex; flex-direction: column; gap: 0.75rem; }
.cms-image-text .cms-it-gallery img { box-shadow: none; border-radius: 0; }
.cms-it-main { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; background: var(--color-surface); box-shadow: 0 18px 40px -18px rgba(0, 33, 71, 0.35); }
.cms-it-main img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: opacity 0.25s ease, transform 0.6s ease; }
.cms-it-main:hover img { transform: scale(1.03); }
.cms-it-main.is-swapping img { opacity: 0; }
.cms-it-zoom { position: absolute; right: 0.9rem; bottom: 0.9rem; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); opacity: 0; transition: opacity 0.2s ease; }
.cms-it-main:hover .cms-it-zoom, .cms-it-main:focus-visible .cms-it-zoom { opacity: 1; }
.cms-it-thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.5rem; }
/* Many photos: wrap into rows instead of shrinking the thumbnails */
.cms-it-thumbs.is-many { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.cms-it-thumb { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--color-surface); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 0.2s ease; }
.cms-it-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transition: opacity 0.2s ease; }
.cms-it-thumb:hover img, .cms-it-thumb.is-active img { opacity: 1; }
.cms-it-thumb.is-active { outline-color: var(--color-accent-hover); }
.cms-it-thumb:focus-visible, .cms-it-main:focus-visible { outline: 3px solid var(--color-accent-hover); outline-offset: 2px; }
.cms-people { margin-top: 1.8rem; padding-top: 1.5rem; border-top: 1px solid rgba(0, 33, 71, 0.1); }
.cms-people h4 { color: #b45309; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 1rem; }
html[lang="th"] .cms-people h4 { letter-spacing: 0.01em; font-size: 0.9rem; }
.cms-people ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.cms-people li { display: flex; align-items: flex-start; gap: 0.9rem; padding: 1rem 1.1rem; background: var(--color-surface); border-radius: 14px; }
.cms-person-avatar { flex: 0 0 46px; height: 46px; border-radius: 50%; background: var(--color-primary); color: var(--color-accent); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.04em; display: flex; align-items: center; justify-content: center; }
.cms-person-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.cms-person-text strong { color: var(--color-primary); font-size: 1.05rem; line-height: 1.3; }
.cms-person-name { color: var(--color-text); font-size: 0.92rem; line-height: 1.4; }
.cms-person-note { color: var(--color-text-light); font-size: 0.85rem; line-height: 1.45; margin-top: 0.3rem; }
.cms-person-note i { color: var(--color-accent-hover); margin-right: 0.2rem; }

/* cards */
.cms-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.cms-cards.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cms-card { display: flex; flex-direction: column; background: #fff; border: 1px solid rgba(0, 33, 71, 0.08); border-radius: 20px; overflow: hidden; box-shadow: 0 12px 28px rgba(0, 33, 71, 0.06); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.cms-card:hover { transform: translateY(-5px); box-shadow: 0 22px 44px rgba(0, 33, 71, 0.12); }
.cms-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.cms-card-body { padding: 1.4rem 1.5rem 1.6rem; }
.cms-card h3 { font-size: 1.2rem; color: var(--color-primary); margin: 0 0 0.5rem; line-height: 1.3; }
.cms-card p { font-size: 0.97rem; line-height: 1.65; color: var(--color-text-light); margin: 0; }
a.cms-card { color: inherit; text-decoration: none; }
a.cms-card:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
a.cms-card .cms-card-body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.cms-card-more { display: inline-flex; margin-top: auto; padding-top: 0.9rem; color: var(--color-primary); font-size: 0.9rem; transition: transform 0.2s ease; } /* sits at the card bottom */
a.cms-card:hover .cms-card-more { transform: translateX(4px); }
@media (max-width: 960px) { .cms-cards, .cms-cards.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cms-cards, .cms-cards.cols-4 { grid-template-columns: 1fr; } }

/* spaces (alternating rows, from Our Campus) */
.campus-rows { display: flex; flex-direction: column; gap: 8rem; }
.campus-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5rem; }
.campus-row.reverse { flex-direction: row-reverse; }
.campus-image-wrapper { flex: 1.2; min-width: 300px; position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 40px rgba(0, 33, 71, 0.08); }
.campus-image-wrapper::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05); border-radius: 16px; pointer-events: none; }
.campus-image-wrapper > img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.campus-row:hover .campus-image-wrapper > img { transform: scale(1.04); }
/* a row with extra photos: main photo + thumbnails (the .cms-it-* gallery from image + text) */
.campus-image-wrapper.has-gallery { overflow: visible; border-radius: 0; box-shadow: none; }
.campus-image-wrapper.has-gallery::after { content: none; }
.campus-image-wrapper .cms-it-main { aspect-ratio: 16 / 10; box-shadow: 0 20px 40px rgba(0, 33, 71, 0.08); }
.campus-image-wrapper .cms-it-main img { object-position: center; }
.campus-text-wrapper { flex: 1; min-width: 300px; padding: 1rem 0; }
.campus-tag { display: inline-block; padding: 6px 16px; background: rgba(251, 191, 36, 0.15); color: #b45309; font-size: 0.8rem; font-weight: 700; border-radius: 20px; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 1.5rem; }
.campus-title { font-size: 2.2rem; color: var(--color-primary); margin-bottom: 1.2rem; font-weight: 700; position: relative; }
.campus-title::after { content: ''; display: block; width: 50px; height: 3px; background-color: var(--color-accent); margin-top: 1.2rem; border-radius: 2px; }
.campus-desc { font-size: 1.15rem; color: var(--color-text); line-height: 1.8; }

/* quote */
.cms-quote { text-align: center; max-width: 850px; margin-left: auto; margin-right: auto; }
.cms-quote .fa-quote-left { font-size: 2.4rem; color: var(--color-accent); margin-bottom: 1.4rem; }
.cms-quote .quote-text { font-size: clamp(1.25rem, 2.2vw, 1.55rem); font-weight: 600; color: var(--color-primary); line-height: 1.65; margin-bottom: 2rem; }
.cms-quote .quote-text:last-child { margin-bottom: 0; }
.cms-quote .quote-author { display: flex; align-items: center; justify-content: center; gap: 1rem; font-weight: 600; font-size: 0.95rem; }
.cms-quote .quote-author::before, .cms-quote .quote-author::after { content: ''; height: 1px; width: 40px; background-color: #cbd5e1; }
.quote-box { position: relative; max-width: 950px; background: linear-gradient(135deg, var(--color-surface) 0%, #ffffff 100%); border: 1px solid rgba(0, 33, 71, 0.05); padding: 5rem 4rem 4rem; border-radius: 24px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03); }
.quote-box .quote-text { font-size: 1.5rem; font-weight: 600; line-height: 1.8; margin-bottom: 0; }
.quote-box .quote-author { margin-top: 2rem; }
.quote-icon { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: var(--color-accent); width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: white; font-size: 1.5rem; box-shadow: 0 10px 20px rgba(251, 191, 36, 0.3); }

/* letter */
.cms-letter { max-width: 850px; margin-left: auto; margin-right: auto; color: var(--color-text); }
.cms-letter .letter-photo { text-align: center; margin-bottom: 4rem; }
.cms-letter .letter-photo img { max-width: 340px; width: 100%; border-radius: 16px; box-shadow: 0 15px 35px rgba(0, 33, 71, 0.1); aspect-ratio: 1/1; object-fit: cover; }
.cms-letter h3 { font-size: 1.8rem; color: var(--color-primary); margin-bottom: 2rem; font-weight: 700; text-align: center; }
.cms-letter .cms-p { line-height: 1.8; margin-bottom: 1.5rem; }
.cms-letter .signature { text-align: right; margin-top: 2.5rem; }
.cms-letter .signature .name { margin-bottom: 0.2rem; font-weight: 700; color: var(--color-primary); font-size: 1.15rem; }
.cms-letter .signature .title { font-style: italic; color: var(--color-text-light); }
.cms-letter::after { content: ''; display: block; width: 100%; height: 1px; background-color: rgba(0, 33, 71, 0.08); margin-top: 5rem; }

/* team (from Our Team) */
.team-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.5rem; justify-items: center; align-items: start; padding: 0 1rem; }
.team-card { width: 100%; max-width: 250px; aspect-ratio: 1/1; border-radius: 16px; overflow: hidden; border: 4px solid #ffffff; box-shadow: 0 10px 25px rgba(255, 255, 255, 0.8), 0 10px 25px rgba(0, 33, 71, 0.08); transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease; position: relative; padding: 0; background: none; cursor: pointer; }
.team-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(255, 255, 255, 1), 0 20px 40px rgba(0, 33, 71, 0.12); }
.team-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; display: block; }
.team-card img:hover { transform: scale(1.05); }
@media (max-width: 1024px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .team-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }


/* gallery */
/* Mosaic: the first photo is large; captions sit on the photo */
.cms-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 230px; grid-auto-flow: dense; gap: 1rem; }
.cms-gallery figure { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: var(--color-surface); box-shadow: 0 12px 28px rgba(0, 33, 71, 0.1); }
.cms-gallery figure:first-child { grid-column: span 2; grid-row: span 2; }
.cms-gallery figure:last-child:nth-child(4n) { grid-column: span 2; }
.cms-gallery button { position: absolute; inset: 0; padding: 0; border: 0; background: none; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.cms-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.cms-gallery figure:hover img { transform: scale(1.05); }
.cms-gallery figure::after { content: ''; position: absolute; inset: 45% 0 0 0; background: linear-gradient(180deg, transparent, rgba(0, 20, 48, 0.75)); pointer-events: none; }
.cms-gallery figcaption { position: absolute; z-index: 1; left: 1rem; right: 1rem; bottom: 0.9rem; color: #fff; font-size: 0.92rem; font-weight: 600; line-height: 1.35; text-align: left; pointer-events: none; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.cms-gallery figure:first-child figcaption { font-size: 1.1rem; left: 1.4rem; bottom: 1.2rem; }
/* Even grid for posters: square tiles, nothing spans, captions only in the lightbox */
.cms-gallery.is-grid { grid-auto-rows: auto; }
.cms-gallery.is-grid figure, .cms-gallery.is-grid figure:first-child, .cms-gallery.is-grid figure:last-child:nth-child(4n) { grid-column: auto; grid-row: auto; aspect-ratio: 1 / 1; }
.cms-gallery.is-grid figure::after, .cms-gallery.is-grid figcaption { display: none; }
.cms-gallery.is-grid figure:hover img { transform: scale(1.03); }
@media (max-width: 960px) {
    .cms-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 200px; }
    .cms-gallery figure:last-child:nth-child(4n) { grid-column: auto; }
    .cms-gallery:not(.is-grid) figure:last-child:nth-child(even) { grid-column: span 2; }
}
@media (max-width: 640px) {
    .cms-gallery { grid-auto-rows: 150px; gap: 0.6rem; }
    .cms-gallery figcaption { font-size: 0.8rem; left: 0.7rem; right: 0.7rem; bottom: 0.6rem; }
}

/* products */
.cms-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2rem; }
.cms-product { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 33, 71, 0.08); border: 1px solid rgba(0, 0, 0, 0.04); display: flex; flex-direction: column; }
.cms-product img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--color-surface); }
.cms-product .body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.cms-product h3 { font-size: 1.15rem; color: var(--color-primary); margin: 0; }
.cms-product .price { font-weight: 700; color: #b45309; font-size: 1.1rem; }
.cms-product p { color: var(--color-text-light); font-size: 0.95rem; line-height: 1.6; margin: 0; }

/* files */
.cms-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.cms-file { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 33, 71, 0.08); border: 1px solid rgba(0, 0, 0, 0.04); display: flex; flex-direction: column; }
.cms-file .cover { aspect-ratio: 3/4; background: var(--color-surface); display: flex; align-items: center; justify-content: center; }
.cms-file .cover img { width: 100%; height: 100%; object-fit: cover; }
.cms-file .cover .fa-file-pdf { font-size: 4rem; color: #c62828; opacity: 0.8; }
.cms-file .body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.cms-file h3 { font-size: 1.2rem; color: var(--color-primary); margin: 0; }
.cms-file p { color: var(--color-text-light); font-size: 0.95rem; line-height: 1.6; margin: 0; }
.cms-file .btn { margin-top: auto; align-self: flex-start; }

/* PDF viewer: title bar + the browser's PDF viewer; touch devices get a cover that opens the file instead */
.pdf-card { border: 1px solid rgba(0, 33, 71, 0.1); border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 20px 45px -20px rgba(0, 33, 71, 0.25); }
.pdf-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; background: var(--color-primary); color: #fff; }
.pdf-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.12); color: var(--color-accent); font-size: 1.2rem; }
.pdf-name { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
.pdf-name strong { font-size: 1.05rem; line-height: 1.35; }
.pdf-name span { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; }
.pdf-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.pdf-actions .btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.15rem; font-size: 0.9rem; line-height: 1.3; white-space: nowrap; }
.pdf-bar .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.pdf-bar .btn-outline:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; color: #fff; }
.pdf-frame { height: min(85vh, 1100px); min-height: 560px; background: #525659; }
.pdf-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.pdf-cover { display: none; position: relative; aspect-ratio: 3 / 2; background: var(--color-surface); text-decoration: none; }
.pdf-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdf-cover-cta { position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.75rem 1.4rem; border-radius: 999px;
    background: var(--color-accent); color: var(--color-primary); font-weight: 700; white-space: nowrap; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25); }
.pdf-cover:not(:has(img)) .pdf-cover-cta { top: 50%; bottom: auto; transform: translate(-50%, -50%); }
@media (hover: none), (max-width: 760px) {
    .pdf-frame { display: none; }
    .pdf-cover { display: block; }
    /* the cover below already opens the file, so the bar only needs Download */
    .pdf-actions .btn-outline { display: none; }
}
@media (max-width: 560px) {
    .pdf-bar { gap: 0.9rem; padding: 1rem; }
    .pdf-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .pdf-name strong { font-size: 1rem; }
    .pdf-name span { font-size: 0.8rem; }
    .pdf-actions { width: 100%; }
    .pdf-actions .btn { flex: 1; justify-content: center; min-height: 46px; font-size: 0.95rem; }
    .pdf-cover-cta { padding: 0.65rem 1.2rem; font-size: 0.92rem; }
}

/* video */
.cms-video { max-width: 960px; margin-left: auto; margin-right: auto; }
.cms-video .frame { position: relative; padding-top: 56.25%; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 40px rgba(0, 33, 71, 0.12); }
.cms-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* call to action */
.cms-cta { background: var(--color-surface); border-radius: 24px; padding: 3.5rem 2rem; text-align: center; border: 1px solid rgba(0, 33, 71, 0.06); }
.cms-cta h2 { font-size: 2rem; color: var(--color-primary); margin-bottom: 1rem; }
.cms-cta p { color: var(--color-text-light); font-size: 1.1rem; max-width: 700px; margin: 0 auto 2rem; line-height: 1.7; }

.cms-empty { text-align: center; color: var(--color-text-light); padding: 3rem 0; font-size: 1.1rem; }

@media (max-width: 768px) {
    .cms-blocks > * + * { margin-top: 4rem; }
    .campus-rows { gap: 4rem; }
    .campus-row, .cms-image-text { gap: 2rem; }
    .quote-box { padding: 4rem 1.5rem 2.5rem; }
    .cms-section-head h2, .cms-intro h2 { font-size: 2rem; }
}
@media (max-width: 560px) {
    .cms-section-head { margin-bottom: 2.25rem; }
    .cms-section-head h2, .cms-intro h2 { font-size: 1.75rem; }
    .cms-section-head p { font-size: 1rem; line-height: 1.7; }
}

/* Team cards are designed images with text: show them large enough to read */
.team-grid { grid-template-columns: repeat(3, minmax(0, 320px)); justify-content: center; gap: 2rem; }
.team-card { max-width: 320px; }
@media (max-width: 1024px) { .team-grid { grid-template-columns: repeat(2, minmax(0, 300px)); } }
@media (max-width: 640px) { .team-grid { grid-template-columns: minmax(0, 340px); } }

/* timeline: "year at a glance" links, then one chapter per item (label + key phrase on the left, the story on the right).
   The 5:7 columns line up with the intro and single-video blocks on co-curricular. */
/* year at a glance: one card per item, joined by a short gold line at icon height */
.tl-year { --tl-gap: 1.5rem; --tl-pad: 1.75rem; margin: 0 0 4.5rem; }
.tl-year ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--tl-gap); }
.tl-year li { position: relative; }
.tl-year li:not(:last-child)::after { content: ''; position: absolute; top: calc(var(--tl-pad) + 23px); left: 100%; width: var(--tl-gap); height: 2px; background: rgba(251, 191, 36, 0.7); }
.tl-year a { position: relative; display: flex; flex-direction: column; height: 100%; padding: var(--tl-pad) var(--tl-pad) 1.5rem; overflow: hidden;
    border: 1px solid rgba(0, 33, 71, 0.1); border-radius: 20px; background: #fff; color: inherit; text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 33, 71, 0.04); transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.tl-year a::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.tl-year a:hover { transform: translateY(-4px); border-color: rgba(0, 33, 71, 0.16); box-shadow: 0 18px 40px -16px rgba(0, 33, 71, 0.28); }
.tl-year a:hover::before { transform: scaleX(1); }
.tl-year a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }
.tl-year-top { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.3rem; }
.tl-year-icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary); color: var(--color-accent); font-size: 1.05rem; }
.tl-year-label { color: #b45309; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
html[lang="th"] .tl-year-label { font-size: 0.9rem; letter-spacing: 0; text-transform: none; }
.tl-year-title { color: var(--color-primary); font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.45rem; }
.tl-year-text { color: var(--color-text-light); font-size: 0.98rem; line-height: 1.55; }
.tl-year-more { margin-top: auto; padding-top: 1.4rem; }
.tl-year-more i { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(0, 33, 71, 0.15); color: var(--color-primary); font-size: 0.8rem; transition: background-color 0.2s ease, border-color 0.2s ease; }
.tl-year a:hover .tl-year-more i { background: var(--color-accent); border-color: var(--color-accent); }
@media (prefers-reduced-motion: reduce) { .tl-year a, .tl-year a::before { transition: none; } .tl-year a:hover { transform: none; } }

.tl-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid rgba(0, 33, 71, 0.12); }
.tl-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); padding: 4.5rem 0; border-top: 1px solid rgba(0, 33, 71, 0.12); scroll-margin-top: 90px; }
.tl-meta { position: sticky; top: 110px; align-self: start; }
.tl-label { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1.2rem; color: #b45309; font-size: 1rem; font-weight: 600; }
.tl-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary); color: var(--color-accent); font-size: 1rem; }
.tl-highlight { margin: 0; max-width: 12em; color: var(--color-primary); font-size: clamp(2rem, 3.6vw, 3.1rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.015em; }
html[lang="th"] .tl-highlight { line-height: 1.35; letter-spacing: 0; }
.tl-content { max-width: 680px; }
.tl-content h3 { font-size: clamp(1.5rem, 2.2vw, 1.85rem); color: var(--color-primary); line-height: 1.25; margin: 0 0 0.4rem; }
.tl-tagline { margin: 0 0 1.6rem; color: var(--color-text-light); font-size: 1.1rem; font-weight: 600; }
.tl-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; margin: 0 0 1.6rem; }
.tl-content .tl-p { font-size: 1.06rem; line-height: 1.85; color: var(--color-text); margin: 0 0 1.1rem; }
.tl-content .tl-p:last-of-type { margin-bottom: 0; }
.tl-watch { display: inline-flex; align-items: center; gap: 0.7rem; margin-top: 1.8rem; padding: 0.45rem 1.2rem 0.45rem 0.45rem; border: 1px solid rgba(0, 33, 71, 0.15); border-radius: 999px; color: var(--color-primary); font-weight: 700; text-decoration: none; transition: border-color 0.2s ease, background-color 0.2s ease; }
.tl-watch:hover { border-color: var(--color-accent); background: rgba(251, 191, 36, 0.08); }
.tl-watch:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.tl-watch-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--color-accent); color: var(--color-primary); font-size: 0.8rem; }
.tl-watch-icon i { margin-left: 2px; }
/* a step's photo gallery: full width under the story, 4 columns, tiles sized in timeline.php */
.tl-photos { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: clamp(120px, 14.5vw, 205px); grid-auto-flow: dense; gap: 0.75rem; }
.tl-photo { position: relative; min-width: 0; }
.tl-photo.is-big { grid-column: span 2; grid-row: span 2; }
.tl-photo.is-end { grid-column: 3 / span 2; grid-row: calc(var(--tl-rows) - 1) / span 2; }
.tl-photo.is-wide { grid-column: span 2; }
.tl-photo.is-solo { grid-column: 1 / -1; grid-row: span 2; }
.tl-photo button { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--color-surface); cursor: zoom-in; }
.tl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.tl-photo button::after { content: ''; position: absolute; inset: 0; background: rgba(0, 33, 71, 0); transition: background-color 0.3s ease; }
.tl-photo button:hover img { transform: scale(1.05); }
.tl-photo button:hover::after { background: rgba(0, 33, 71, 0.12); }
.tl-photo button:focus-visible { outline: 3px solid var(--color-accent-hover); outline-offset: 2px; }
.tl-photo-cap { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 2.2rem 1rem 0.85rem; color: #fff; font-size: 0.9rem; font-weight: 600; text-align: left;
    background: linear-gradient(transparent, rgba(0, 20, 45, 0.75)); }
@media (prefers-reduced-motion: reduce) { .tl-photo img { transition: none; } .tl-photo button:hover img { transform: none; } }
@media (max-width: 640px) {
    .tl-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 120px; gap: 0.5rem; }
    .tl-photo.is-end { grid-column: 1 / -1; grid-row: span 2; }
    .tl-photo button { border-radius: 10px; }
}
@media (max-width: 900px) {
    .tl-year { --tl-gap: 1rem; --tl-pad: 1.4rem; margin-bottom: 3rem; }
    .tl-year ol { grid-auto-flow: row; }
    .tl-year li:not(:last-child)::after { top: 100%; left: calc(var(--tl-pad) + 22px); width: 2px; height: var(--tl-gap); }
    .tl-year-top { margin-bottom: 1rem; }
    .tl-year-more { display: none; }
    .tl-item { grid-template-columns: 1fr; gap: 1.4rem; padding: 3rem 0; }
    .tl-meta { position: static; }
    .tl-label { margin-bottom: 0.8rem; }
    .tl-highlight { font-size: 2rem; }
    .tl-content h3 { font-size: 1.35rem; }
}

/* videos: player + playlist on a full-width navy band (the band's sides are a box-shadow, so no horizontal scroll) */
.cms-videos { position: relative; padding: 96px 0 104px; color: #fff; background: #002147; box-shadow: 0 0 0 100vmax #002147; clip-path: inset(0 -100vmax); }
.cms-videos::before { content: ''; position: absolute; inset: 0; opacity: 0.07; pointer-events: none; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%); }
.cms-blocks > .cms-videos + * { margin-top: 7rem; }
.cms-videos .cms-section-head { position: relative; margin-bottom: 3rem; }
.cms-videos .cms-section-head h2 { color: #fff; margin: 0 0 0.8rem; }
.cms-videos .cms-section-head p { color: rgba(255, 255, 255, 0.75); }
.vg { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.75rem; align-items: start; }
.vg-player { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000; cursor: pointer; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4); }
.vg-player img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.9; transition: opacity 0.3s ease, transform 0.6s ease; }
.vg-player:hover img { opacity: 1; transform: scale(1.02); }
.vg-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vg-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--color-accent); color: var(--color-primary); font-size: 1.7rem; cursor: pointer; box-shadow: 0 0 0 14px rgba(251, 191, 36, 0.28); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.vg-play i { margin-left: 6px; }
.vg-player:hover .vg-play { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 20px rgba(251, 191, 36, 0.2); }
.vg-caption { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.3rem; }
.vg-caption h3 { margin: 0; color: #fff; font-size: 1.35rem; line-height: 1.3; }
.vg-tag { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(251, 191, 36, 0.16); color: var(--color-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.vg-tag[hidden] { display: none; }
.vg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.vg-item { width: 100%; display: flex; align-items: center; gap: 1rem; padding: 0.65rem; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; background: rgba(255, 255, 255, 0.04); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease; }
.vg-item:hover { background: rgba(255, 255, 255, 0.09); }
.vg-item.is-current { background: rgba(255, 255, 255, 0.12); border-color: rgba(251, 191, 36, 0.7); }
.vg-thumb { position: relative; flex-shrink: 0; width: 132px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.vg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vg-thumb i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding-left: 2px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.75rem; }
.vg-item.is-current .vg-thumb i { background: var(--color-accent); color: var(--color-primary); }
.vg-meta { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.vg-meta small { color: var(--color-accent); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.vg-meta strong { color: #fff; font-size: 0.95rem; line-height: 1.35; }
.vg-now { display: none; color: rgba(255, 255, 255, 0.6); font-size: 0.75rem; }
.vg-item.is-current .vg-now { display: block; }
/* side by side, the list is as tall as the player + caption and a longer list scrolls (taken out of flow,
   so only the player sets the row height; its grid area is still its containing block) */
@media (min-width: 1081px) {
    .vg-list { position: absolute; grid-column: 2; grid-row: 1; inset: 0; overflow-y: auto; align-content: start; padding-right: 0.4rem;
        scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
    .cms-videos.is-light .vg-list { scrollbar-color: rgba(0, 33, 71, 0.25) transparent; }
}

/* videos: light variant (no band) */
.cms-videos.is-light { padding: 0; color: inherit; background: none; box-shadow: none; clip-path: none; }
.cms-videos.is-light::before { display: none; }
.cms-videos.is-light .cms-section-head h2 { color: var(--color-primary); }
.cms-videos.is-light .cms-section-head p { color: var(--color-text-light); }
.cms-videos.is-light .vg-caption h3 { color: var(--color-primary); }
.cms-videos.is-light .vg-tag { background: rgba(251, 191, 36, 0.18); color: #b45309; }
.cms-videos.is-light .vg-player { box-shadow: 0 25px 50px rgba(0, 33, 71, 0.18); }
.cms-videos.is-light .vg-item { background: #fff; border-color: rgba(0, 33, 71, 0.1); }
.cms-videos.is-light .vg-item:hover { background: var(--color-surface); }
.cms-videos.is-light .vg-item.is-current { background: var(--color-surface); border-color: var(--color-accent); }
.cms-videos.is-light .vg-meta small { color: #b45309; }
.cms-videos.is-light .vg-meta strong { color: var(--color-primary); }
.cms-videos.is-light .vg-now { color: var(--color-text-light); }
/* videos: a single video sits beside its heading */
.cms-videos.is-single .vg { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); gap: 4rem; align-items: center; }
.vg-intro h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.2; margin: 0 0 1rem; color: #fff; }
.cms-videos.is-light .vg-intro h2 { color: var(--color-primary); }
.vg-intro .vg-intro-text { font-size: 1.06rem; line-height: 1.8; margin: 0 0 1.8rem; color: rgba(255, 255, 255, 0.78); }
.cms-videos.is-light .vg-intro .vg-intro-text { color: var(--color-text-light); }
.vg-now-card { padding: 1.3rem 1.4rem; border-left: 4px solid var(--color-accent); border-radius: 0 16px 16px 0; background: rgba(255, 255, 255, 0.06); }
.cms-videos.is-light .vg-now-card { background: var(--color-surface); }
.vg-now-card h3 { margin: 0.7rem 0 0; font-size: 1.15rem; line-height: 1.4; color: #fff; }
.cms-videos.is-light .vg-now-card h3 { color: var(--color-primary); }

@media (max-width: 1080px) {
    .vg { grid-template-columns: 1fr; }
    .cms-videos.is-single .vg { grid-template-columns: 1fr; gap: 2rem; }
    .vg-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .cms-videos { padding: 72px 0 80px; }
    .vg-list { grid-template-columns: 1fr; }
    .vg-thumb { width: 112px; }
    .vg-play { width: 70px; height: 70px; font-size: 1.35rem; }
}

/* co-curricular: left-aligned headings on one 5:7 grid (intro, single video and timeline share the columns),
   with the single-video highlight on a full-width surface band */
.cms-page-co-curricular .cms-section-head { text-align: left; max-width: 760px; margin-left: 0; margin-right: 0; }
.cms-page-co-curricular h2, .tl-highlight, .tl-content h3 { text-wrap: balance; }
.cms-page-co-curricular .cms-intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem clamp(2rem, 5vw, 5rem); max-width: none; text-align: left; align-items: start; }
.cms-page-co-curricular .cms-intro .accent-bar { display: none; }
.cms-page-co-curricular .cms-intro h2 { margin: 0; max-width: 11em; font-size: clamp(2.1rem, 3.8vw, 3.1rem); line-height: 1.15; }
.cms-page-co-curricular .cms-intro-body { max-width: 680px; padding-top: 0.4rem; }
.cms-page-co-curricular .cms-videos.is-light { padding: 88px 0; background: var(--color-surface); box-shadow: 0 0 0 100vmax var(--color-surface); clip-path: inset(0 -100vmax); }
.cms-page-co-curricular .cms-videos.is-single .vg { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); }
.cms-page-co-curricular .cms-videos .vg-now-card { padding: 1.3rem 0 0; border: 0; border-top: 1px solid rgba(0, 33, 71, 0.15); border-radius: 0; background: none; }
.cms-page-co-curricular .cms-videos .vg-tag { padding: 0; border-radius: 0; background: none; font-size: 0.95rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.cms-page-co-curricular .cms-videos .vg-meta small { font-size: 0.8rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.cms-page-co-curricular .cms-gallery figure:not(:has(figcaption))::after { display: none; }
@media (max-width: 1080px) {
    .cms-page-co-curricular .cms-videos.is-single .vg { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 900px) {
    .cms-page-co-curricular .cms-intro { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .cms-page-co-curricular .cms-videos.is-light { padding: 64px 0; }
}
