/**
 * page-templates.css — styles for the manoir page templates:
 * page.php, page-gallery.php, page-contact.php, page-accommodation.php.
 *
 * Every rule is namespaced under .manoir-* so this file can coexist with the
 * main theme stylesheet without collisions. All colors/fonts reference the
 * theme's design tokens through var() WITH literal fallbacks, so the
 * templates render correctly even before the global :root tokens ship.
 */

/* =========================================================================
   Shared building blocks
   ========================================================================= */

/* ---- Navy hero band (interior pages) ------------------------------------ */

.manoir-hero-band {
    position:        relative;
    background:      var(--color-ink, #2c3a45);
    color:           var(--color-on-dark, #fbf8f6);
    /* Room for the ~89px fixed transparent header that overlays this band. */
    padding:         calc(var(--header-h, 89px) + 6vw) 1.25rem 9vw;
    text-align:      center;
}

.manoir-hero-band__inner {
    max-width:       var(--content-max, 1432px);
    margin:          0 auto;
}

.manoir-hero-band__title {
    font-family:     var(--font-heading, "Cormorant Garamond", "Playfair Display", Georgia, serif);
    font-weight:     var(--heading-weight, 200);
    font-size:       var(--text-section-title, clamp(2rem, 3.7vw, 3.35rem));
    line-height:     1.0;
    letter-spacing:  var(--tracking-heading, -0.02em);
    margin:          0;
}

.manoir-hero-band__subtitle {
    font-family:     var(--font-heading, "Cormorant Garamond", "Playfair Display", Georgia, serif);
    font-weight:     var(--heading-weight, 200);
    font-size:       clamp(1.15rem, 1.8vw, 1.6rem);
    letter-spacing:  var(--tracking-heading, -0.02em);
    margin:          1rem 0 0;
}

/* ---- Diamond ornament: line — diamond — line ----------------------------- */

.manoir-ornament {
    display:         flex;
    align-items:     center;
    justify-content: center;
    gap:             0.75rem;
    margin-top:      2rem;
}

.manoir-ornament__line {
    display:         block;
    width:           min(180px, 22vw);
    height:          1px;
    background:      currentColor;
    position:        relative;
}

/* Small diamond endpoints at the outer tips of each line. */
.manoir-ornament__line::before {
    content:         "";
    position:        absolute;
    top:             50%;
    width:           5px;
    height:          5px;
    background:      currentColor;
    transform:       translateY(-50%) rotate(45deg);
}

.manoir-ornament__line:first-child::before  { left: 0; }
.manoir-ornament__line:last-child::before   { right: 0; }

.manoir-ornament__diamond {
    display:         block;
    width:           clamp(14px, 2.5vw, 26px);
    height:          clamp(14px, 2.5vw, 26px);
    background:      currentColor;
    transform:       rotate(45deg);
    flex-shrink:     0;
}

/* Ornament grows relatively larger on mobile, like the source site. */
@media (max-width: 767px) {
    .manoir-ornament__diamond { width: 30px; height: 30px; }
}

/* ---- Convex curved bottom divider (dark band → cream) --------------------
   Héritage reads as flat and architectural — hairline borders, not curved
   dividers — so this shape is suppressed rather than removed from the PHP
   helper that emits it (keeps the option easy to restore later). */

.manoir-curve {
    display:         none;
    position:        absolute;
    left:            0;
    right:           0;
    bottom:          -1px; /* overlap kills sub-pixel seams on fractional zoom */
    line-height:     0;
    pointer-events:  none;
}

.manoir-curve svg {
    display:         block;
    width:           100%;
    height:          clamp(28px, 5vw, 70px);
}

.manoir-curve path {
    fill:            var(--color-bg, #fbf8f6);
}

/* ---- Cream content sections ---------------------------------------------- */

.manoir-content-section {
    background:      var(--color-bg, #fbf8f6);
    color:           var(--color-ink, #2c3a45);
    padding:         var(--section-pad-lg, 6.6vw) 1.25rem;
}

.manoir-content-section--compact {
    padding-top:     var(--section-pad-md, 3.3vw);
    padding-bottom:  var(--section-pad-md, 3.3vw);
}

.manoir-content-section__inner {
    max-width:       860px; /* ~55ch editorial column, per source rhythm */
    margin:          0 auto;
}

/* ---- Prose (rendered block content) -------------------------------------- */

.manoir-prose {
    font-family:     var(--font-body, "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif);
    font-weight:     var(--body-weight, 300);
    font-size:       clamp(0.85rem, 0.95vw, 0.95rem);
    line-height:     1.6;
}

.manoir-prose h2,
.manoir-prose h3,
.manoir-heading-serif {
    font-family:     var(--font-heading, "Cormorant Garamond", "Playfair Display", Georgia, serif);
    font-weight:     var(--heading-weight, 200);
    letter-spacing:  var(--tracking-heading, -0.02em);
    line-height:     1.05;
    color:           var(--color-ink, #2c3a45);
}

.manoir-prose h2      { font-size: clamp(1.5rem, 2.4vw, 2.1rem);  margin: 2.5rem 0 1rem; }
.manoir-prose h3      { font-size: clamp(1.25rem, 1.9vw, 1.65rem); margin: 2rem 0 0.85rem; }
.manoir-heading-serif { font-size: clamp(1.4rem, 2.2vw, 1.9rem);   margin: 0 0 1.25rem; }

.manoir-prose a {
    color:           var(--color-accent-2, #917a6e);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Square corners on every image — signature of the source design. */
.manoir-prose img,
.manoir-page img {
    border-radius:   var(--img-radius, 0);
    max-width:       100%;
    height:          auto;
}

.manoir-prose figure { margin: 2rem 0; }

/* Figures inside a reconstructed .gallery grid are spaced by the grid gap. */
.manoir-prose .gallery figure { margin: 0; }

/* Ported "photo card" pattern: a heading that captions the image directly
   above it (activity cards, gallery categories). Pull the caption tight to
   its own photo so the pair reads as one card, not as a heading for the
   NEXT photo further down. */
.manoir-prose figure + h2,
.manoir-prose figure + h3 {
    margin-top: 0.6rem;
}

/* In-page category navigation for ported gallery pages (galerie-photos):
   a centered row of pill anchors jumping to each category heading. */
.manoir-gallery-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    list-style: none;
    margin: 0 0 2.5rem;
    padding: 0;
}

.manoir-gallery-nav a {
    display: inline-block;
    padding: 0.55em 1.2em;
    border: 0.8px solid currentColor;
    border-radius: 300px;
    text-decoration: none;
    font-variant: small-caps;
}

.manoir-gallery-nav a:hover {
    background: var(--color-ink, #2c3a45);
    color: var(--color-bg, #fbf8f6);
}

/* Anchored category headings land clear of the fixed header. */
.manoir-prose h2[id],
.manoir-prose h3[id] {
    scroll-margin-top: calc(var(--header-h, 89px) + 1rem);
}

.manoir-prose hr {
    border:          none;
    border-top:      0.8px solid currentColor;
    opacity:         0.35;
    margin:          2.5rem auto;
    max-width:       220px;
}

.manoir-prose blockquote {
    margin:          2rem 0;
    padding-left:    1.25rem;
    border-left:     1px solid var(--color-accent, #a3af97);
    font-style:      italic;
}

/* ---- Buttons -------------------------------------------------------------- */

.manoir-btn {
    display:         inline-block;
    font-family:     var(--font-button, "Lexend", system-ui, sans-serif);
    font-variant:    small-caps; /* Francesco small-caps look, font-agnostic */
    font-size:       var(--text-button, 0.875rem);
    font-weight:     300;
    letter-spacing:  0.04em;
    padding:         var(--btn-pad, 14px 22px);
    line-height:     1;
    cursor:          pointer;
    text-decoration: none;
    transition:      opacity 0.2s ease;
    color:           inherit;
    background:      transparent;
}

.manoir-btn:hover,
.manoir-btn:focus-visible { opacity: 0.7; }

/* Outline pill — the site's dominant CTA shape. */
.manoir-btn--pill {
    border:          var(--btn-border, 0.8px solid currentColor);
    border-radius:   var(--btn-radius-pill, 300px);
}

/* Solid sage — header/primary emphasis variant. */
.manoir-btn--solid {
    background:      var(--color-accent, #a3af97);
    color:           var(--color-on-dark, #fbf8f6);
    border:          none;
    border-radius:   var(--btn-radius-solid, 5.6px);
}

/* ---- Icons (inline Tabler SVGs) ------------------------------------------- */

.manoir-icon {
    width:           1.35em;
    height:          1.35em;
    flex-shrink:     0;
    vertical-align:  -0.25em;
}

/* ---- Closing CTA band (sage wash) ----------------------------------------- */

.manoir-cta-band {
    background:      var(--color-accent-wash, rgba(163, 175, 151, 0.49));
    color:           var(--color-ink, #2c3a45);
    text-align:      center;
    padding:         var(--section-pad-lg, 6.6vw) 1.25rem;
}

.manoir-cta-band__title {
    font-family:     var(--font-heading, "Cormorant Garamond", "Playfair Display", Georgia, serif);
    font-weight:     var(--heading-weight, 200);
    font-size:       clamp(1.5rem, 2.6vw, 2.3rem);
    letter-spacing:  var(--tracking-heading, -0.02em);
    line-height:     1.05;
    margin:          0 0 1.75rem;
}

/* ---- Child-page cross links (page.php) ------------------------------------ */

.manoir-child-pages { padding-top: 0; }

.manoir-child-pages__list {
    list-style:      none;
    margin:          0;
    padding:         0;
    display:         flex;
    flex-wrap:       wrap;
    gap:             1rem;
    justify-content: center;
}

/* =========================================================================
   Gallery template (page-gallery.php)
   ========================================================================= */

.manoir-gallery__inner {
    max-width:       var(--content-max, 1432px);
    margin:          0 auto;
}

/* Deliberate mosaic grid (Héritage spirit): a repeating 6-tile rhythm —
   one big feature tile, four regular cells, one wide tile — rather than
   an organic CSS-columns masonry. Cells are a fixed row height and images
   are cropped to cover, which is what lets the big/wide tiles read as
   intentional rather than as leftover whitespace. */
.manoir-gallery__grid {
    display:              grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows:       220px;
    gap:                  var(--grid-gap, 30px);
}

.manoir-gallery__item {
    margin:          0;
    position:        relative;
    overflow:        hidden;
}

.manoir-gallery__item:nth-child(12n+1) {
    grid-column:     span 2;
    grid-row:        span 2;
}

.manoir-gallery__item:nth-child(12n+6),
.manoir-gallery__item:nth-child(12n+9) {
    grid-column:     span 2;
}

@media (max-width: 1000px) {
    .manoir-gallery__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
    .manoir-gallery__item:nth-child(12n+6),
    .manoir-gallery__item:nth-child(12n+9) { grid-column: span 1; }
}

@media (max-width: 600px) {
    .manoir-gallery__grid { grid-template-columns: 1fr; }
    .manoir-gallery__item:nth-child(12n+1) { grid-column: span 1; grid-row: span 1; }
}

.manoir-gallery__img {
    display:         block;
    width:           100%;
    height:          100%;
    object-fit:      cover;
}

/* Fixed-height cropped tiles leave no room for a caption in normal flow —
   overlay it on a bottom scrim instead of pushing the tile taller. */
.manoir-gallery__caption {
    position:        absolute;
    left:            0;
    right:           0;
    bottom:          0;
    margin:          0;
    padding:         1.6rem 1rem 0.7rem;
    background:      linear-gradient(180deg, rgba(18,24,18,0) 0%, rgba(18,24,18,.6) 100%);
    font-family:     var(--font-meta);
    font-weight:     500;
    font-size:       0.7rem;
    letter-spacing:  0.12em;
    text-transform:  uppercase;
    line-height:     1.4;
    color:           var(--color-on-dark);
}

.manoir-gallery__empty {
    font-family:     var(--font-body, "Lexend", system-ui, sans-serif);
    font-weight:     var(--body-weight, 300);
    text-align:      center;
}

/* =========================================================================
   Contact template (page-contact.php)
   ========================================================================= */

.manoir-contact__columns {
    max-width:       var(--content-max, 1432px);
    margin:          0 auto;
    display:         grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap:             clamp(2rem, 5vw, 5.5rem);
}

@media (max-width: 900px) {
    .manoir-contact__columns { grid-template-columns: minmax(0, 1fr); }
}

.manoir-contact__lines {
    list-style:      none;
    margin:          0 0 3rem;
    padding:         0;
    font-family:     var(--font-body, "Lexend", system-ui, sans-serif);
    font-weight:     var(--body-weight, 300);
    font-size:       0.92rem;
    line-height:     1.55;
}

.manoir-contact__line {
    display:         flex;
    align-items:     flex-start;
    gap:             0.85rem;
    margin-bottom:   1.1rem;
}

.manoir-contact__line .manoir-icon { color: var(--color-accent, #a3af97); margin-top: 0.1em; }

.manoir-contact__line a {
    color:           var(--color-ink, #2c3a45);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.manoir-contact__address {
    display:         flex;
    align-items:     flex-start;
    gap:             0.85rem;
    font-style:      normal;
    font-family:     var(--font-body, "Lexend", system-ui, sans-serif);
    font-weight:     var(--body-weight, 300);
    font-size:       0.92rem;
    line-height:     1.6;
    margin-bottom:   2rem;
}

.manoir-contact__address .manoir-icon { color: var(--color-accent, #a3af97); margin-top: 0.1em; }

/* ---- Accordions (native <details>) ---------------------------------------- */

.manoir-accordion {
    border-top:      0.8px solid var(--color-ink, #2c3a45);
    font-family:     var(--font-body, "Lexend", system-ui, sans-serif);
}

.manoir-accordion:last-of-type { border-bottom: 0.8px solid var(--color-ink, #2c3a45); }

.manoir-accordion summary {
    cursor:          pointer;
    list-style:      none;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         1rem 0.25rem;
    font-weight:     600;
    font-size:       0.95rem;
}

.manoir-accordion summary::-webkit-details-marker { display: none; }

/* Chevron that flips when the accordion opens. */
.manoir-accordion summary::after {
    content:         "";
    width:           0.55em;
    height:          0.55em;
    border-right:    1.5px solid currentColor;
    border-bottom:   1.5px solid currentColor;
    transform:       rotate(45deg);
    transition:      transform 0.25s ease;
    flex-shrink:     0;
}

.manoir-accordion[open] summary::after { transform: rotate(-135deg); }

.manoir-accordion__body {
    padding:         0 0.25rem 1.15rem;
    font-weight:     var(--body-weight, 300);
    font-size:       0.88rem;
    line-height:     1.6;
}

.manoir-accordion__body p { margin: 0 0 0.75rem; }

/* ---- Map ------------------------------------------------------------------ */

.manoir-contact__map { margin-top: 2.5rem; }

.manoir-contact__map iframe {
    display:         block;
    width:           100%;
    min-height:      340px;
    border:          0;
    filter:          grayscale(1); /* matches the source site's grayscale map */
}

.manoir-contact__map-link { margin-top: 2.5rem; }

/* ---- Contact form ---------------------------------------------------------- */

.manoir-form {
    font-family:     var(--font-body, "Lexend", system-ui, sans-serif);
}

.manoir-form__row {
    display:         grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap:             1rem;
}

@media (max-width: 540px) {
    .manoir-form__row { grid-template-columns: minmax(0, 1fr); }
}

.manoir-form__field { margin-bottom: 1.25rem; }

.manoir-form__field label {
    display:         block;
    font-weight:     600;
    font-size:       0.85rem;
    margin-bottom:   0.45rem;
}

.manoir-form__required {
    font-weight:     300;
    opacity:         0.65;
}

/* White pill-ish inputs on cream, no visible border — source form style. */
.manoir-form__field input,
.manoir-form__field textarea {
    width:           100%;
    box-sizing:      border-box;
    background:      var(--color-surface, #ffffff);
    color:           var(--color-ink, #2c3a45);
    border:          1px solid transparent;
    border-radius:   24px;
    padding:         0.75rem 1.1rem;
    font:            inherit;
    font-weight:     300;
    font-size:       0.9rem;
}

.manoir-form__field textarea {
    border-radius:   18px;
    resize:          vertical;
    min-height:      9rem;
}

.manoir-form__field input:focus-visible,
.manoir-form__field textarea:focus-visible {
    outline:         none;
    border-color:    var(--color-accent, #a3af97);
    box-shadow:      0 0 0 2px var(--color-accent-wash, rgba(163, 175, 151, 0.49));
}

/* Honest-mailto notice: quiet but unmissable, sage-tinted info strip. */
.manoir-form__notice {
    display:         flex;
    align-items:     flex-start;
    gap:             0.65rem;
    background:      var(--color-accent-wash, rgba(163, 175, 151, 0.49));
    padding:         0.9rem 1.1rem;
    font-size:       0.8rem;
    font-weight:     300;
    line-height:     1.55;
    margin:          1.5rem 0;
}

.manoir-form__notice .manoir-icon { margin-top: 0.05em; }

.manoir-form__submit { margin-top: 0.25rem; }

/* =========================================================================
   Accommodation template (page-accommodation.php)
   ========================================================================= */

/* ---- Photo hero ------------------------------------------------------------ */

.manoir-photo-hero {
    position:        relative;
    min-height:      clamp(420px, 62vh, 680px);
    display:         flex;
    align-items:     flex-end;
    justify-content: center;
    text-align:      center;
    color:           var(--color-on-dark, #fbf8f6);
    overflow:        hidden;
}

.manoir-photo-hero__img {
    position:        absolute;
    inset:           0;
    width:           100%;
    height:          100%;
    object-fit:      cover;
}

.manoir-photo-hero__scrim {
    position:        absolute;
    inset:           0;
    background:      var(--overlay-hero, rgba(0, 0, 0, 0.30));
}

.manoir-photo-hero__inner {
    position:        relative;
    z-index:         1;
    max-width:       var(--content-max, 1432px);
    padding:         calc(var(--header-h, 89px) + 4vw) 1.25rem 10vw;
}

/* ---- Key facts strip -------------------------------------------------------- */

.manoir-facts {
    list-style:      none;
    margin:          0 auto;
    padding:         0;
    max-width:       var(--content-max, 1432px);
    display:         flex;
    flex-wrap:       wrap;
    justify-content: center;
    gap:             clamp(1.25rem, 4vw, 4rem);
    font-family:     var(--font-body, "Lexend", system-ui, sans-serif);
    font-weight:     600;
    font-size:       0.95rem;
    color:           var(--color-ink, #2c3a45);
}

.manoir-facts__item {
    display:         flex;
    align-items:     center;
    gap:             0.6rem;
}

.manoir-facts__item .manoir-icon { color: var(--color-accent, #a3af97); }

/* ---- Amenities -------------------------------------------------------------- */

.manoir-amenities__list {
    list-style:      none;
    margin:          0;
    padding:         0;
    display:         grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap:             0.75rem 2rem;
    font-family:     var(--font-body, "Lexend", system-ui, sans-serif);
    font-weight:     var(--body-weight, 300);
    font-size:       0.9rem;
}

.manoir-amenities__item {
    display:         flex;
    align-items:     flex-start;
    gap:             0.6rem;
    line-height:     1.5;
}

.manoir-amenities__item .manoir-icon {
    color:           var(--color-accent, #a3af97);
    margin-top:      0.1em;
}

/* =========================================================================
   Reduced motion — the only animation here is the accordion chevron
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
    .manoir-btn,
    .manoir-accordion summary::after { transition: none; }
}
