/*
Theme Name: Villa Catherine
Description: Thème sur mesure pour la Villa Catherine, Nosy Be.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: villa-catherine
*/

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face { font-family: 'Playfair Display'; font-weight: 400; font-display: swap; src: url(assets/fonts/playfair-400.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url(assets/fonts/playfair-700.woff2) format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 400; font-display: swap; src: url(assets/fonts/lato-400.woff2) format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 900; font-display: swap; src: url(assets/fonts/lato-900.woff2) format('woff2'); }

:root {
    --vc-gold: #c5a148;
    --vc-gold-dark: #9c7e2f;
    --vc-slate: #3a3a49;
    --vc-ink: #444;
    --vc-sand: #f7f3ea;
    --vc-line: #e5e1d6;
    --vc-gutter: clamp(16px, 4vw, 40px);
    --vc-header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }

.screen-reader-text, .skip-link:not(:focus) {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; background: #fff; padding: 8px 16px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: #fff; color: var(--vc-slate);
    box-shadow: 0 1px 0 var(--vc-line);
    transition: background-color .3s, color .3s, box-shadow .3s;
}
.has-hero .site-header { position: fixed; inset: 0 0 auto; background: transparent; color: #fff; box-shadow: none; }
.has-hero .site-header::before {
    content: ''; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none;
    background: linear-gradient(rgba(0,0,0,.45), transparent); transition: opacity .3s;
}
.has-hero .site-header.is-scrolled { background: #fff; color: var(--vc-slate); box-shadow: 0 1px 0 var(--vc-line); }
.has-hero .site-header.is-scrolled::before { opacity: 0; }
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }

.site-header__inner {
    max-width: 1280px; margin: 0 auto; padding: 0 var(--vc-gutter);
    height: var(--vc-header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-logo { display: block; color: inherit; line-height: 0; }
.site-logo svg { height: 56px; width: auto; }
/* Colour logo: round badge hanging below the header bar, shrinks once the page is scrolled */
.site-header .site-logo { align-self: flex-start; }
.site-logo__img {
    display: block; width: 112px; height: 112px; margin-top: 10px;
    border-radius: 50%; background: #fff; border: 3px solid #fff; box-sizing: border-box;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
    transition: width .25s, height .25s, margin .25s;
}
.site-header.is-scrolled .site-logo__img { width: 68px; height: 68px; margin-top: 8px; }

.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(14px, 2vw, 30px); }
.primary-nav a {
    color: inherit; text-decoration: none; font-size: .8125rem; font-weight: 900;
    letter-spacing: .1em; text-transform: uppercase; padding: 8px 0; border-bottom: 2px solid transparent;
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { border-bottom-color: var(--vc-gold); }
.primary-nav .menu-item--cta > a { background: var(--vc-gold); color: #fff; padding: 10px 18px; border: 0; }
.primary-nav .menu-item--cta > a:hover { background: var(--vc-slate); }

.nav-toggle { display: none; background: none; border: 0; color: inherit; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    position: absolute; left: 10px; width: 24px; height: 2px; background: currentColor; transition: transform .25s, opacity .25s;
}
.nav-toggle__bar { top: 21px; }
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ''; left: 0; }
.nav-toggle__bar::before { top: -8px; }
.nav-toggle__bar::after { top: 8px; }
.nav-open .nav-toggle__bar { background: transparent; }
.nav-open .nav-toggle__bar::before { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle__bar::after { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1023px) {
    :root { --vc-header-h: 68px; }
    .site-logo svg { height: 44px; }
    .site-logo__img { width: 80px; height: 80px; margin-top: 6px; }
    .site-header.is-scrolled .site-logo__img { width: 56px; height: 56px; margin-top: 6px; }
    .nav-toggle { display: block; z-index: 2; }
    .primary-nav {
        position: fixed; inset: 0; background: var(--vc-slate); color: #fff;
        display: flex; align-items: center; justify-content: center;
        opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
    }
    .nav-open .primary-nav { opacity: 1; visibility: visible; }
    .nav-open .site-header { color: #fff; }
    .nav-open { overflow: hidden; }
    .primary-nav .menu { flex-direction: column; align-items: center; gap: 22px; }
    .primary-nav a { font-size: 1rem; }
}

/* ---------- Hero ---------- */
.hero { position: relative; height: clamp(340px, 60vh, 620px); color: #fff; display: flex; align-items: flex-end; overflow: hidden; background: var(--vc-slate); }
.hero--full { height: min(100svh, 920px); min-height: 520px; align-items: center; text-align: center; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.55)); }
.hero--full::after { background: rgba(0,0,0,.28); }
.hero__content { position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--vc-gutter) clamp(32px, 6vh, 64px); }
.hero--full .hero__content { padding-bottom: 0; }
.hero__kicker { font-size: .875rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 12px; }
.hero__title { color: #fff; font-size: clamp(2rem, 5vw, 3.75rem); margin: 0; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.hero__subtitle { font-family: 'Playfair Display', serif; font-style: italic; font-size: clamp(1.1rem, 2vw, 1.5rem); margin: 10px 0 0; }
.hero .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.hero .is-style-outline .wp-block-button__link { background: transparent; border: 2px solid #fff; color: #fff; }
.hero .is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--vc-slate); }

.page-header { max-width: 1200px; margin: 0 auto; padding: 56px var(--vc-gutter) 0; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0; }

/* ---------- Content ---------- */
.entry-content { padding: clamp(40px, 6vw, 80px) var(--vc-gutter); }
.entry-content > * { max-width: var(--wp--style--global--content-size, 820px); margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: var(--wp--style--global--wide-size, 1200px); }
.entry-content > .alignfull { max-width: none; margin-left: calc(-1 * var(--vc-gutter)); margin-right: calc(-1 * var(--vc-gutter)); }
.entry-content > :first-child { margin-top: 0; }

.entry-content h2 { font-size: var(--wp--preset--font-size--x-large); margin: 2.2em auto .6em; }
.entry-content h3 { font-size: var(--wp--preset--font-size--large); margin: 1.6em auto .4em; }

/* Kicker + ornament above section titles */
.vc-kicker { color: var(--vc-gold-dark); font-size: .8125rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; text-align: center; margin-bottom: .5em !important; }
.vc-kicker::before {
    content: ''; display: block; width: 90px; height: 12px; margin: 0 auto 18px;
    background: url(assets/img/sep_trait_boule.png) center / contain no-repeat;
}
.vc-kicker + h2 { margin-top: 0; }

.is-style-sand, .has-sand-background-color { background: var(--vc-sand); }
.entry-content > .alignfull.has-background { padding: clamp(40px, 6vw, 80px) var(--vc-gutter); }
.entry-content > .alignfull.has-background > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

/* Galleries: uniform crops, tight grid */
.wp-block-gallery.has-nested-images { gap: 8px; }
.wp-block-gallery.has-nested-images figure.wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s, filter .3s; }
.wp-block-gallery.has-nested-images figure.wp-block-image { overflow: hidden; }
.wp-block-gallery.has-nested-images figure.wp-block-image:hover img { transform: scale(1.04); }

/* Separator: short gold rule */
.entry-content .wp-block-separator { border: 0; border-top: 2px solid var(--vc-gold); width: 80px; margin: clamp(48px, 7vw, 88px) auto; opacity: 1; }

/* Room cards (columns with a gallery + text) */
.vc-room { padding: 32px 0; border-top: 1px solid var(--vc-line); }
.vc-room h3 { margin-top: 0; }
.vc-room .wp-block-column:last-child { align-self: center; }

/* Tables (pricing) */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table thead { border-bottom: 0; }
.wp-block-table th, .wp-block-table td { padding: 14px 12px; border: 0; border-bottom: 1px solid var(--vc-line); text-align: left; vertical-align: middle; }
.wp-block-table thead th { font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: var(--vc-gold-dark); border-bottom: 2px solid var(--vc-gold); }
.wp-block-table td:last-child, .wp-block-table th:last-child { text-align: right; white-space: nowrap; }
.wp-block-table td img { width: 96px; aspect-ratio: 4/3; object-fit: cover; display: block; }
@media (max-width: 600px) { .wp-block-table td img { width: 64px; } .wp-block-table th, .wp-block-table td { padding: 10px 6px; } }

/* Info cards (Pratique) */
.vc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.vc-cards > .wp-block-group { background: var(--vc-sand); padding: 28px; border-top: 3px solid var(--vc-gold); }
.vc-cards h3 { margin-top: 0; }

/* ---------- Embeds: calendar, tour, map ---------- */
.vc-embed { position: relative; background: var(--vc-sand); border: 1px solid var(--vc-line); }
.vc-embed iframe { display: block; width: 100%; border: 0; }
.vc-calendar__month { height: 620px; }
.vc-calendar__agenda { height: 520px; display: none !important; }
@media (max-width: 700px) {
    .vc-calendar__month { display: none !important; }
    .vc-calendar__agenda { display: block !important; }
}

.vc-tour { aspect-ratio: 16 / 9; max-height: 85vh; overflow: hidden; background: #000; }
@media (max-width: 700px) { .vc-tour { aspect-ratio: 3 / 4; } }
.vc-tour iframe { height: 100%; }
.vc-tour__poster {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer;
    background: #000 center / cover no-repeat; color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.vc-tour__poster::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.35); transition: background .3s; }
.vc-tour__poster:hover::before { background: rgba(0,0,0,.2); }
.vc-tour__poster > * { position: relative; }
.vc-tour__play { width: 84px; height: 84px; border-radius: 50%; background: var(--vc-gold); display: grid; place-items: center; box-shadow: 0 6px 30px rgba(0,0,0,.35); }
.vc-tour__play svg { width: 34px; height: 34px; margin-left: 5px; }
.vc-tour__label { font-weight: 900; letter-spacing: .15em; text-transform: uppercase; font-size: .875rem; }
.vc-tour-actions { text-align: center; margin-top: 12px; font-size: .875rem; }

.vc-map { height: 420px; }
.vc-map iframe { height: 100%; }

/* ---------- Forms ---------- */
.vc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.vc-form fieldset { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: contents; }
.vc-form legend { grid-column: 1 / -1; font-family: 'Playfair Display', serif; font-size: 1.375rem; color: var(--vc-slate); margin: 16px 0 0; }
.vc-field { display: flex; flex-direction: column; gap: 6px; }
.vc-field--full { grid-column: 1 / -1; }
.vc-field[hidden] { display: none; }
.vc-field label, .vc-field .vc-label { font-size: .875rem; font-weight: 900; color: var(--vc-slate); }
.vc-field .req { color: var(--vc-gold-dark); }
.vc-form input[type=text], .vc-form input[type=email], .vc-form input[type=tel], .vc-form input[type=date],
.vc-form input[type=number], .vc-form select, .vc-form textarea {
    font: inherit; color: var(--vc-ink); width: 100%; padding: 12px 14px; border: 1px solid #cfc9bb; border-radius: 0; background: #fff;
}
.vc-form textarea { min-height: 130px; resize: vertical; }
.vc-form :focus-visible { outline: 2px solid var(--vc-gold); outline-offset: 1px; }
.vc-choices { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.vc-choices label { font-weight: 400; display: inline-flex; gap: 8px; align-items: center; color: var(--vc-ink); }
.vc-form .vc-hp { position: absolute; left: -9999px; }
.vc-form__consent { grid-column: 1 / -1; font-size: .875rem; }
.vc-form__submit { grid-column: 1 / -1; }
.vc-form button[type=submit] {
    font: inherit; font-size: .875rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
    background: var(--vc-gold); color: #fff; border: 0; padding: 16px 36px; cursor: pointer;
}
.vc-form button[type=submit]:hover { background: var(--vc-slate); }
.vc-notice { padding: 16px 20px; margin-bottom: 24px; border-left: 4px solid; }
.vc-notice--success { background: #eef7ea; border-color: #5a9e3c; }
.vc-notice--error { background: #fbecec; border-color: #c24141; }
.vc-notice ul { margin: 8px 0 0; padding-left: 20px; }
@media (max-width: 640px) { .vc-form { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--vc-slate); color: #d9d8de; font-size: .9375rem; }
.site-footer a { color: #fff; }
.site-footer__inner {
    max-width: 1200px; margin: 0 auto; padding: 56px var(--vc-gutter) 32px;
    display: grid; gap: 32px; grid-template-columns: 1.2fr 1fr 1fr;
}
.site-footer h2 { color: var(--vc-gold); font-family: Lato, sans-serif; font-size: .8125rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; margin: 0 0 12px; }
.site-logo--footer { color: #fff; margin-bottom: 12px; }
.site-logo--footer .site-logo__img { width: 128px; height: 128px; margin: 0; box-shadow: none; }
.site-footer__nav .menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer__nav a { color: #d9d8de; text-decoration: none; }
.site-footer__nav a:hover { color: #fff; }
.site-footer__copy { text-align: center; font-size: .8125rem; padding: 16px; margin: 0; border-top: 1px solid rgba(255,255,255,.1); }
@media (max-width: 800px) { .site-footer__inner { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
