/* ==========================================================================
   pages.css
   Sections used by the inner pages (about, collections, gallery, contact,
   404, privacy). Shared and home-page sections are in sections.css.
   ========================================================================== */

/* ---------- Inner page hero ---------- */
.ks-page-hero__panel { padding: 100px 0 60px; text-align: center; }
.ks-page-hero__title { max-width: 900px; margin-inline: auto; font-size: 46px; }
.ks-page-hero__text { max-width: 600px; margin: 22px auto 0; font-size: 17px; color: var(--ks-muted); line-height: 1.6; }
@media (max-width: 1024px) { .ks-page-hero__title { font-size: var(--ks-h1); } }
@media (max-width: 767px) { .ks-page-hero__panel { padding: 50px 0 36px; } }

/* Wide photo panel with a button in a cut-out at the top (about page) */
.ks-photo-band { position: relative; height: 540px; overflow: hidden; }
.ks-photo-band > img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .ks-photo-band { height: 300px; } }

/* Map placeholder (a live map needs the owner's OK, see docs/NOTES.md) */
.ks-map {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    min-height: 420px;
    padding: 40px;
    border-radius: var(--ks-radius-xl);
    background: var(--ks-cream) repeating-linear-gradient(45deg, transparent 0 22px, rgba(110, 18, 48, 0.04) 22px 44px);
    text-align: center;
}
.ks-map > .ks-icon { width: 44px; height: 44px; color: var(--ks-wine); }
.ks-map p { margin: 0; color: var(--ks-muted); }
@media (max-width: 767px) { .ks-map { min-height: 280px; } }

/* ==========================================================================
   About page
   ========================================================================== */
.ks-about-hero .ks-page-hero__panel { padding-bottom: 115px; }
.ks-about-banner { position: relative; margin-top: -65px; }
.ks-about-banner__img { height: 420px; overflow: hidden; border-radius: var(--ks-radius-xl); }
.ks-about-banner__img picture { display: block; height: 100%; }
.ks-about-banner__img img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.ks-values__intro { max-width: 680px; margin: 0 auto 60px; text-align: center; }
.ks-values__intro h2 { margin-bottom: 26px; }
.ks-values__intro p { font-size: 17px; line-height: 1.65; color: var(--ks-muted); }
.ks-values .ks-feature { min-height: 290px; }
@media (max-width: 767px) { .ks-about-banner__img { height: 260px; } }

/* Our story timeline (alternating cards along a centre line) */
.ks-timeline-panel { position: relative; overflow: hidden; padding: 80px 0 120px; }
.ks-timeline-panel .ks-bg-mark--1 { width: 220px; top: 120px; left: -60px; }
.ks-timeline-panel .ks-bg-mark--2 { width: 140px; top: 60px; right: 6%; }
.ks-timeline { position: relative; max-width: 1056px; margin: 0 auto; padding-top: 120px; }
.ks-timeline::before {          /* the vertical centre line */
    content: "";
    position: absolute;
    left: 50%; top: 30px; bottom: 0;
    width: 1px;
    background: var(--ks-gold);
}
.ks-timeline__dot {
    position: absolute;
    left: 50%; top: 60px;
    width: 22px; height: 22px;
    border: 6px solid var(--ks-wine);
    border-radius: 50%;
    background: var(--ks-white);
    transform: translateX(-50%);
}
.ks-timeline__list { list-style: none; display: grid; gap: 20px; }
.ks-timeline__item {
    width: calc(50% - 90px);
    padding: 40px 40px 36px;
    border-radius: var(--ks-radius-md);
    background: var(--ks-white);
}
.ks-timeline__item:nth-child(even) { margin-left: auto; }   /* cards alternate sides */
.ks-timeline__year { margin: 0 0 8px; font-family: var(--ks-font-head); font-size: 15px; font-weight: 500; letter-spacing: 1px; color: var(--ks-wine-text); }
.ks-timeline__item h3 { margin-bottom: 16px; font-size: var(--ks-h4); }
.ks-timeline__item p { font-size: 15px; color: var(--ks-muted); line-height: 1.55; }
@media (max-width: 1024px) {
    .ks-timeline { padding-top: 90px; }
    .ks-timeline::before, .ks-timeline__dot { left: 20px; }
    .ks-timeline__item, .ks-timeline__item:nth-child(even) { width: auto; margin: 0 0 0 60px !important; }
}
@media (max-width: 767px) { .ks-timeline__item { padding: 30px 22px; } }

/* ==========================================================================
   Collections page
   ========================================================================== */
.ks-collection-tile {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 20px 34px;
    border-radius: var(--ks-radius-lg);
    background: var(--ks-cream);
    scroll-margin-top: calc(var(--ks-header-h) + 20px);   /* anchor links land below the sticky header */
}
.ks-collection-tile__img { position: relative; overflow: hidden; aspect-ratio: 4 / 5; margin-bottom: 30px; border-radius: 22px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 95%); }
.ks-collection-tile__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.6s var(--ks-ease); }
.ks-collection-tile:hover .ks-collection-tile__img img { transform: scale(1.05); }
.ks-collection-tile h2 { margin: 0 10px 14px; font-size: var(--ks-h3); line-height: 1.2; }
.ks-collection-tile p { flex-grow: 1; margin: 0 10px 22px; font-size: 15px; color: var(--ks-muted); line-height: 1.55; }
.ks-collection-tile__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 10px 28px; list-style: none; }
.ks-collection-tile__tags li { padding: 5px 12px; border: 1px solid var(--ks-line); border-radius: 30px; background: var(--ks-white); font-size: 13px; font-weight: 400; }
.ks-collection-tile .ks-arrow-link { margin-inline: 10px; }

.ks-addons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ks-addon {
    display: flex;
    gap: 16px;
    padding: 14px 20px 28px 14px;
    border-radius: var(--ks-radius-lg);
    background: var(--ks-cream);
}
.ks-addon .ks-icon-box { flex-shrink: 0; }
.ks-addon__price { margin: 16px 0 8px; font-size: 14px; font-weight: 500; color: var(--ks-wine-text); }
.ks-addon__label { margin: 0 0 6px; font-family: var(--ks-font-head); font-size: 18px; font-weight: 400; line-height: 1.4; }
.ks-addon__text { margin: 0; font-size: 14px; color: var(--ks-muted); line-height: 1.5; }
@media (max-width: 1024px) { .ks-addons { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .ks-addons { grid-template-columns: 1fr; } }
.ks-center-btn { margin: 60px 0 0; text-align: center; }

/* "Rental terms" toggle box */
.ks-terms { margin-top: 90px; border: 1px solid var(--ks-gold); border-radius: var(--ks-radius-lg); }
.ks-terms summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    min-height: 84px;
    padding: 0 20px;
    font-family: var(--ks-font-head);
    font-size: 18px;
    cursor: pointer;
    list-style: none;
}
.ks-terms summary::-webkit-details-marker { display: none; }
.ks-terms__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ks-cream); color: var(--ks-wine-text); font-size: 16px; transition: transform 0.3s; }
.ks-terms[open] .ks-terms__icon { transform: rotate(180deg); }
.ks-terms ul { columns: 2; gap: 50px; max-width: 960px; margin: 0 auto; padding: 0 30px 40px 50px; color: var(--ks-muted); line-height: 1.8; }
.ks-terms li { break-inside: avoid; margin-bottom: 6px; }
@media (max-width: 767px) { .ks-terms ul { columns: 1; padding: 0 20px 30px 36px; } }

/* ==========================================================================
   Gallery page: filter buttons, photo grid, lightbox
   ========================================================================== */
.ks-gallery-filters { margin-bottom: 50px; }
.ks-gallery-filters .ks-tabs__list { margin-bottom: 0; }
.ks-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    grid-auto-flow: dense;                    /* fill gaps left by tall/wide tiles */
    gap: 16px;
    list-style: none;
}
.ks-gallery__item[hidden] { display: none; }
.ks-gallery__item--tall { grid-row: span 2; }
.ks-gallery__item--wide { grid-column: span 2; }
.ks-gallery__item--big { grid-column: span 2; grid-row: span 2; }
.ks-gallery__btn {
    position: relative;
    display: block;
    width: 100%; height: 100%;
    overflow: hidden;
    border-radius: var(--ks-radius-md);
    text-align: left;
}
.ks-gallery__btn img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.6s var(--ks-ease); }
.ks-gallery__btn::after {                 /* soft dark fade at the bottom for the caption */
    content: "";
    position: absolute;
    inset: 40% 0 0;
    background: linear-gradient(180deg, transparent, rgba(36, 22, 27, 0.75));
    opacity: 0;
    transition: opacity 0.4s;
}
.ks-gallery__caption {
    position: absolute;
    left: 18px; right: 52px; bottom: 16px;
    z-index: 1;
    color: var(--ks-white);
    font-family: var(--ks-font-head);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s, transform 0.4s;
}
.ks-gallery__zoom {
    position: absolute;
    right: 14px; bottom: 14px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--ks-gold);
    color: var(--ks-black);
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.4s;
}
.ks-gallery__btn:hover img, .ks-gallery__btn:focus-visible img { transform: scale(1.05); }
.ks-gallery__btn:hover::after, .ks-gallery__btn:focus-visible::after,
.ks-gallery__btn:hover .ks-gallery__caption, .ks-gallery__btn:focus-visible .ks-gallery__caption,
.ks-gallery__btn:hover .ks-gallery__zoom, .ks-gallery__btn:focus-visible .ks-gallery__zoom { opacity: 1; transform: none; }
/* Touch screens have no hover, so captions always show there */
@media (hover: none) {
    .ks-gallery__btn::after, .ks-gallery__caption { opacity: 1; transform: none; }
}
.ks-gallery__empty { margin-top: 30px; text-align: center; color: var(--ks-muted); }
@media (max-width: 1024px) { .ks-gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px) {
    .ks-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; gap: 10px; }
    .ks-gallery__item--big, .ks-gallery__item--wide { grid-column: span 2; }
    .ks-gallery__caption { font-size: 14px; left: 12px; bottom: 10px; }
    .ks-gallery__zoom { display: none; }
}

/* Lightbox: native <dialog>, so focus is trapped and Escape closes it */
.ks-lightbox {
    width: 100%; height: 100%;
    max-width: none; max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(24, 14, 18, 0.94);
    color: var(--ks-white);
}
.ks-lightbox::backdrop { background: transparent; }
.ks-lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.ks-lightbox__stage { display: grid; place-items: center; min-height: 0; padding: 70px 80px 10px; }
.ks-lightbox__img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 12px; object-fit: contain; }
.ks-lightbox__caption { margin: 0; padding: 14px 20px 28px; text-align: center; font-family: var(--ks-font-head); font-size: 18px; }
.ks-lightbox__btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--ks-white);
    font-size: 22px;
    transition: background-color 0.3s, color 0.3s;
}
.ks-lightbox__btn:hover { background: var(--ks-gold); color: var(--ks-black); }
.ks-lightbox__btn--close { top: 16px; right: 16px; }
.ks-lightbox__btn--prev { left: 16px; top: 50%; transform: translateY(-50%); }
.ks-lightbox__btn--next { right: 16px; top: 50%; transform: translateY(-50%); }
.ks-lightbox__count { position: absolute; top: 28px; left: 24px; margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.75); }
@media (max-width: 767px) {
    .ks-lightbox__stage { padding: 70px 12px 10px; }
    .ks-lightbox__btn--prev, .ks-lightbox__btn--next { top: auto; bottom: 18px; transform: none; }
    .ks-lightbox__caption { padding: 14px 70px 30px; font-size: 16px; }
}

/* Scroll hint for horizontal rows on small screens (global "scroll hint" rule, see scroll-hint.js) */
.ks-scroller { position: relative; }
.ks-scroller__track { overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.ks-scroller__track::-webkit-scrollbar { display: none; }
.ks-scroller.has-more-right .ks-scroller__track { mask-image: linear-gradient(90deg, #000 80%, transparent); }
.ks-scroller.has-more-left .ks-scroller__track { mask-image: linear-gradient(90deg, transparent, #000 20%); }
.ks-scroller.has-more-left.has-more-right .ks-scroller__track { mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
.ks-scroller__btn {
    position: absolute;
    top: 50%; z-index: 2;
    display: grid; place-items: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ks-white);
    color: var(--ks-wine-text);
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    opacity: 0; pointer-events: none;
    transform: translateY(-50%);
    transition: opacity 0.3s;
}
.ks-scroller__btn--left { left: 4px; }
.ks-scroller__btn--right { right: 4px; }
.ks-scroller.has-more-left .ks-scroller__btn--left,
.ks-scroller.has-more-right .ks-scroller__btn--right { opacity: 1; pointer-events: auto; }
.ks-scroller.is-nudging .ks-scroller__btn--right { animation: ks-nudge 0.6s ease-in-out 2; }
@keyframes ks-nudge { 50% { transform: translate(5px, -50%); } }
@media (max-width: 767px) {
    .ks-tabs__list--scroll { flex-wrap: nowrap; justify-content: flex-start; width: max-content; padding-inline: 16px; }
    .ks-tabs__list--scroll .ks-tabs__tab { white-space: nowrap; }
}

/* ==========================================================================
   Contact page
   ========================================================================== */
.ks-contact-cards__link { font-weight: 400; color: var(--ks-black); text-decoration: underline; text-underline-offset: 3px; }
.ks-contact-cards__link:hover { color: var(--ks-wine-text); }

/* ==========================================================================
   404 and plain text pages
   ========================================================================== */
.ks-404 { padding: 100px 0 40px; text-align: center; }
.ks-404__oops { margin: 0; font-size: 16px; font-weight: 400; }
.ks-404__num { margin: 0; font-family: var(--ks-font-head); font-size: 210px; font-weight: 600; line-height: 1; color: var(--ks-gold); }
.ks-404 h1 { margin: 20px 0 15px; font-size: var(--ks-h3); }
.ks-404__text { margin-bottom: 35px; color: var(--ks-muted); }
@media (max-width: 767px) { .ks-404__num { font-size: 130px; } }
.ks-prose { max-width: 830px; margin: 50px auto 0; color: var(--ks-muted); line-height: 1.65; }
.ks-prose h2 { margin: 50px 0 18px; font-size: var(--ks-h4); }
.ks-prose ul { margin: 0 0 1em 20px; }
