/* @import ./components/page-carousel.css */
/* ─── In-page carousel widget (pasteable from CMS) ─────────────────── */

.page-carousel {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    background: #000;
    margin: 0 0 2rem;
}

.page-carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.page-carousel-slide.is-active {
    opacity: 1;
}

.page-carousel-prev,
.page-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.page-carousel-prev { left: 1rem; }
.page-carousel-next { right: 1rem; }

.page-carousel-prev:hover,
.page-carousel-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .page-carousel { height: 50vh; min-height: 280px; }
    .page-carousel-prev, .page-carousel-next { width: 40px; height: 40px; }
}
/* @import ./components/news-carousel.css */
.news-carousel {
    padding: 3rem 0 4rem;
    margin: 0 2rem;
}

.news-card {
    flex: 0 0 calc((100% - 5rem) / 6); 
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

.news-card-link {
    display: flex;
    flex-direction: column;
    color: #000;
    text-decoration: none;
}

.news-card-link:hover .news-card-title {
    color: #666;
}

.news-card-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
}
.news-card-thumb-empty {
    background: linear-gradient(135deg, #f5f5f5 25%, #eee 25%, #eee 50%, #f5f5f5 50%, #f5f5f5 75%, #eee 75%);
    background-size: 20px 20px;
}

.news-card-body {
    padding: 1rem 0 0;
}

.news-card-date {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.5rem;
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    transition: color 0.15s ease;
}

@media (max-width: 1600px) { .news-card { flex-basis: calc((100% - 4rem) / 5); } }
@media (max-width: 1280px) { .news-card { flex-basis: calc((100% - 3rem) / 4); } }
@media (max-width: 1024px) { .news-card { flex-basis: calc((100% - 2rem) / 3); } }
@media (max-width: 768px)  { .news-card { flex-basis: calc((100% - 1rem) / 2); } }
@media (max-width: 480px)  { .news-card { flex-basis: 80%; } }
/* @import ./books.css */
.page-books, .page-book { background: #fff; }

/* ─── Listing page ─────────────────────────────────────────────────── */

.books-page {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.books-header { text-align: center; margin-bottom: 3rem; }

.books-heading {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.books-empty {
    padding: 4rem 1rem;
    text-align: center;
    color: #999;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5rem 1.5rem;
}

/* ─── Book card (shared by carousel + grid) ────────────────────────── */

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

.card-carousel-track .book-card {
    /* same sizing rules as .perf-card in carousels */
    flex: 0 0 calc((100% - 4rem) / 5);
    scroll-snap-align: start;
}

.book-card-link {
    display: flex;
    flex-direction: column;
    color: #000;
    text-decoration: none;
    flex: 1;
}

.book-card-cover {
    width: 100%;
    overflow: hidden;
}

/* Covers vary in aspect ratio — show each one at its natural proportions
   instead of cropping to a fixed box. */
.book-card-cover-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.book-card-link:hover .book-card-cover-img {
    transform: scale(1.02);
}

.book-card-cover-empty {
    aspect-ratio: 4 / 3;
    background: repeating-linear-gradient(
        45deg, #f5f5f5, #f5f5f5 10px, #eee 10px, #eee 20px
    );
}

/* In the horizontal carousel keep card heights uniform: fit the whole
   cover inside a fixed band, centred, no cropping. */
.card-carousel-track .book-card-cover {
    height: 220px;
    background: #f0f0f0;
}

.card-carousel-track .book-card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.book-card-body {
    padding: 1rem 0 0;
}

.book-card-author {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.5rem;
}

.book-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.5rem;
}

.book-card-year {
    font-size: 0.85rem;
    color: #666;
}

/* ─── Book detail page ─────────────────────────────────────────────── */

.book {
    max-width: var(--container-lg);
    margin: 0 auto;
}

.book-back {
    padding: 1rem 2rem;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.book-back a { color: inherit; text-decoration: underline; }
.book-back a:hover { text-decoration: none; color: #000; }
.book-back-sep { margin: 0 0.5rem; color: #ccc; }

.book-detail {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
    gap: 3rem;
    padding: 3rem 2rem;
}

.book-detail-cover img {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.book-detail-cover-empty {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: repeating-linear-gradient(
        45deg, #f5f5f5, #f5f5f5 20px, #eee 20px, #eee 40px
    );
}

.book-detail-author {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    margin-bottom: 0.75rem;
}

.book-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 1.5rem;
}

.book-detail-about {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #222;
    margin-bottom: 2rem;
}

.book-detail-about p { margin: 0 0 1em; }

.book-detail-meta {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.5rem 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.book-detail-meta dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
}

.book-detail-meta dd {
    margin: 0;
    font-size: 0.95rem;
}

.book-detail-more {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

.book-detail-more p { margin: 0 0 1em; }

/* ─── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 1280px) {
    .books-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-carousel-track .book-card { flex-basis: calc((100% - 3rem) / 4); }
}

@media (max-width: 1024px) {
    .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-carousel-track .book-card { flex-basis: calc((100% - 2rem) / 3); }
}

@media (max-width: 768px) {
    .books-page { padding: 1rem 1rem 3rem; }
    .books-heading { font-size: 1.75rem; }
    .book-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1rem;
    }
    .book-detail-title { font-size: 1.75rem; }
    .book-detail-meta { grid-template-columns: 1fr; gap: 0.25rem 0; }
    .book-detail-meta dd { margin-bottom: 0.5rem; }
    .card-carousel-track .book-card { flex-basis: calc((100% - 1rem) / 2); }
}

@media (max-width: 480px) {
    .books-grid { grid-template-columns: 1fr; }
    .card-carousel-track .book-card { flex-basis: 60%; }
}
/* @import ./pages/visit.css */
/* public/css/pages/visit.css */

/* ─── Page heading ─────────────────────────────────────────────────── */

.page-content h1 {
    font-size: clamp(2rem, 4vw, 3.75rem);
    font-weight: 700;
    color: #000;
    text-align: center;
    text-transform: none;
    padding: 2.5rem 0 1.875rem;
    margin: 0;
}

/* ─── Poster blocks (used by editor inside page bodies) ────────────── */
/* The `.poster` base styles already live in components/poster.css.
   These overrides are specific to legacy visit-page poster placements
   inside page items. */

.page-item .poster {
    height: 480px;
    width: 100%;
    background: center / cover no-repeat;
    background-color: #000;
    position: relative;
    margin-bottom: 2rem;
}

@media (min-width: 1280px) {
    .page-item .poster { height: 580px; }
}

@media (min-width: 1600px) {
    .page-item .poster { height: 735px; }
}

.page-item .poster .caption {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    max-width: 40vw;
    color: #fff;
    text-align: right;
    font-size: 1rem;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* ─── Two-column table layout in page items ────────────────────────── */
/* Legacy editor markup pastes <table> for the "logo + intro" layout.
   We respect that structure but normalize the look. */

.page-item table {
    width: 100%;
    border-collapse: collapse;
}

.page-item table td {
    vertical-align: top;
    padding: 0;
}

.page-item table td:first-child {
    width: 276px;
    padding-right: 2rem;
}

.page-item table td:last-child {
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    /* Tables collapse to stacked on mobile */
    .page-item table,
    .page-item table tbody,
    .page-item table tr,
    .page-item table td {
        display: block;
        width: 100% !important;
    }
    .page-item table td:first-child {
        padding-right: 0;
        padding-bottom: 1rem;
    }
}

.page-item img.logo {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* ─── History sections (timeline-style) ────────────────────────────── */

.page-item.history {
    width: 100%;
    border-bottom: none;
    padding-bottom: 0;
}

.page-item.history table td:first-child {
    width: auto;
    padding-right: 0;
    font-size: 1rem;
    line-height: 1.6;
    border-bottom: 1px solid #b5b5b5;
    padding-bottom: 2rem;
}

.page-item.history:last-child table td:first-child {
    border-bottom: none;
}

.page-item.history table td:last-child {
    font-weight: 500;
    font-size: 0.875rem;
    width: 310px;
    padding-left: 6.25rem;
}

.page-item.history table td:last-child > div {
    background-color: #ebebeb;
    padding: 1.5rem;
}

.page-item.history h2 {
    text-align: left;
}

.page-item.history:first-of-type h2 {
    display: none;
}

/* ─── Hide title on the first page item (poster takes its place) ───── */

.page-item.first .page-item-title {
    display: none;
}

@media (max-width: 1024px) {
    .page-item.history table td:last-child {
        width: 240px;
        padding-left: 2rem;
    }
}

@media (max-width: 768px) {
    .page-item.history table td:last-child {
        width: 100%;
        padding-left: 0;
        padding-top: 1rem;
    }
}
.page {
    max-width: 75%;
    margin: 0 auto;
    padding: 2rem;
}

.page-body {
    margin-bottom: 3rem;
}

/* Anchored-heading sticky nav now uses the shared component
   (components/sticky-nav.css + partials/sticky-nav.twig). */

/* ─── Page items themselves ────────────────────────────────────────── */

.page-items {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.page-item {
    scroll-margin-top: 80px;  /* belt + suspenders alongside JS offset */
}

.page-item-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.page-item-body {
    line-height: 1.6;
}

.page-item-body img {
    max-width: 100%;
    height: auto;
}

.page-body .row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.page-body [class^="col-"] { padding: 0 15px; }
.page-body .col-6 { flex: 0 0 50%; max-width: 50%; }
.page-body .col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.page-body .col-8 { flex: 0 0 66.667%; max-width: 66.667%; }
/* etc. — add classes as legacy content uses them */

@media (max-width: 768px) {
    .page-body [class^="col-"] { flex-basis: 100%; max-width: 100%; }
    .page { padding: 1rem; }
    .page-items-menu { gap: 1rem; font-size: 0.75rem; }
}

.page-back {
    max-width: 75%;
    margin: 0 auto;
    padding: 0 2rem 0;
    font-size: 0.85rem;
    color: #666;
}

.page-back a { color: inherit; text-decoration: underline; }
.page-back a:hover { text-decoration: none; color: #000; }

.page-heading {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1.5rem 0 2rem;
    text-align: center;
}

@media (max-width: 768px) {
    .page-back { max-width: 100%; padding: 1rem 1rem 0; }
    .page-heading { font-size: 1.75rem; }
}
/* ─── Block-based page content ─────────────────────────────────────── */

.page-blocks {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    line-height: 1.6;
}

.page-blocks .block { margin: 0; }

.block-heading--2 { font-size: 2rem;   font-weight: 700; margin-top: 1rem; }
.block-heading--3 { font-size: 1.4rem; font-weight: 700; margin-top: 0.5rem; }

.block-text p { margin: 0 0 1rem; }
.block-text p:last-child { margin-bottom: 0; }
.block-text ul, .block-text ol { margin: 0 0 1rem; padding-left: 1.5rem; }
/* Inline links inside the text block use the shared prose-link palette
   (var(--color-link)) — the `inherit` override below would otherwise
   force black against the parent body colour. */
.block-text a {
    color: var(--color-link);
    text-decoration: none;
}
.block-text a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.block-image picture { display: block; }
.block-image img { display: block; width: 100%; height: auto; }
.block-image--wide   { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.block-image--inline { max-width: 420px; }
.block-caption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #777;
}

.block-gallery--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}
.block-gallery--carousel {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
}
.block-gallery--carousel .block-gallery-item {
    flex: 0 0 60%;
    scroll-snap-align: start;
}
.block-gallery-item { position: relative; display: block; overflow: hidden; }
.block-gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.block-gallery-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.75rem 0.7rem 0.55rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.block-gallery-item:hover .block-gallery-cap { opacity: 1; }

.block-video-frame {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.block-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.block-quote {
    border-left: 3px solid #000;
    padding-left: 1.25rem;
    font-size: 1.2rem;
    font-style: italic;
}
.block-quote-text { margin: 0; }
.block-quote-author {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-style: normal;
    color: #777;
}

.block-divider {
    border: 0;
    border-top: 1px solid #ddd;
    width: 100%;
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .block-gallery--carousel .block-gallery-item { flex-basis: 80%; }
    .block-heading--2 { font-size: 1.5rem; }
}

/* poster block — centered banner (page-column width, not full-bleed). Keeps
   the photo's own aspect ratio (set inline from the image dimensions),
   clamped between 20vh and 50vh tall; `cover` crops when clamping bites. */
.block-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;          /* fallback — overridden inline per image */
    min-height: 20vh;
    max-height: 50vh;
    background: center / cover no-repeat #000;
}
.block-poster-caption {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    max-width: 60%;
    color: #fff;
    text-align: right;
    font-size: 1.15rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* columns layout block */
.block-columns { display: flex; gap: 1.75rem; }
.block-column { min-width: 0; }
.page-blocks .block-column > .block { margin-bottom: 1.25rem; }
.page-blocks .block-column > .block:last-child { margin-bottom: 0; }
/* keep a full-bleed image block from breaking out when nested in a column */
.block-column .block-image--wide {
    width: 100%; margin-left: 0; transform: none;
}
@media (max-width: 768px) {
    .block-columns { flex-direction: column; gap: 1rem; }
}

/* buttons block — square outline link-buttons.
   Default: transparent background, black border + text.
   Hover:   fills to solid black with white text, same border.
   Selector is doubled with `.page-blocks .block-btn` so the global
   prose-link rule (`.page-blocks a { color: link-blue }`) doesn't
   repaint the text. */
.block-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.page-blocks .block-btn,
.block-btn {
    display: inline-block;
    padding: 0.55rem 1.15rem;
    border: 1px solid #000;
    border-radius: 0;
    background: transparent;
    color: #000;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: background-color 0.15s, color 0.15s;
}
.page-blocks .block-btn:hover,
.block-btn:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

/* anchored heading blocks — clear the sticky page-nav menu when scrolled to */
.page-blocks .block-heading[id] { scroll-margin-top: 90px; }
