/*
Theme Name: Mahogany Bay
Theme URI: https://mahoganybayvillas.com/blog/
Author: Red Brick Media
Author URI: https://redbrickmedia.ca
Description: Blog theme for Mahogany Bay Villas. Matches the villa showcase site (Cormorant Garamond + Jost, espresso and gold), with built-in SEO and AI-search structured data, an llms.txt feed, related posts and ready-made design blocks for the team.
Version: 1.0.9
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mahoganybay
*/

/* ===== Brand tokens (same as the villa page) ===== */
:root {
  --sand: #f5ede0;
  --deep: #1a1410;
  --ocean: #2c5f6e;
  --gold: #c9a84c;
  --gold-dark: #9c7f2e;
  --warm: #8b6340;
  --mist: #e8ddd0;
  --light: #faf7f3;
  --ink: #2b2420;
  --muted: #74675b;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 720px;
  --wide: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--light);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ocean); text-underline-offset: 3px; }
a:hover { color: var(--warm); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.screen-reader-text { 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: 999; width: auto; height: auto; clip: auto; background: var(--gold); color: var(--deep); padding: 10px 16px; }

.wrap { width: min(var(--wide), 100% - 40px); margin-inline: auto; }
.measure { width: min(var(--measure), 100% - 40px); margin-inline: auto; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(26, 20, 16, 0.96);
  backdrop-filter: blur(8px);
  color: var(--sand);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--sand); text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.brand b { color: var(--gold); font-weight: 600; }
.brand:hover { color: var(--sand); }
.nav-toggle { display: none; background: none; border: 0; color: var(--sand); font-size: 1.6rem; cursor: pointer; padding: 6px 8px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 26px; }
.site-nav a { color: #e9dfcc; text-decoration: none; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 400; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current_page_parent > a { color: var(--gold); }
.site-nav .menu-cta a, .site-nav a.menu-cta { background: var(--gold); color: var(--deep); padding: 10px 18px; }
.site-nav .menu-cta a:hover { background: #d8b85b; color: var(--deep); }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--deep); display: none; padding: 8px 20px 20px; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li a { display: block; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
  .site-nav .menu-cta a { margin-top: 14px; text-align: center; border: 0; }
}

/* ===== Blog hero (listing pages) ===== */
.blog-hero { background: var(--deep); color: var(--sand); padding: 72px 0 60px; position: relative; overflow: hidden; }
.blog-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 80% at 50% 120%, rgba(44,95,110,.55), transparent 65%), radial-gradient(ellipse 50% 50% at 15% 10%, rgba(201,168,76,.12), transparent 60%); }
.blog-hero .wrap { position: relative; }
.eyebrow { display: block; font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); font-weight: 400; margin-bottom: 16px; }
.blog-hero h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; margin: 0 0 16px; color: var(--sand); max-width: 16ch; text-wrap: balance; }
.blog-hero h1 em { color: var(--gold); font-style: italic; }
.blog-hero p { color: rgba(245,237,224,.72); max-width: 56ch; margin: 0; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.cat-chips a { border: 1px solid rgba(201,168,76,.5); color: var(--sand); text-decoration: none; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; padding: 7px 14px; }
.cat-chips a:hover, .cat-chips a.active { background: var(--gold); border-color: var(--gold); color: var(--deep); }

/* ===== Post cards ===== */
.posts { padding: 56px 0 80px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 32px; }
.post-grid.has-lead .card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr; }
.post-grid.has-lead .card:first-child .card-img { aspect-ratio: auto; height: 100%; min-height: 360px; }
.post-grid.has-lead .card:first-child .card-title { font-size: clamp(1.8rem, 3vw, 2.4rem); }
@media (max-width: 860px) { .post-grid.has-lead .card:first-child { display: block; } .post-grid.has-lead .card:first-child .card-img { min-height: 0; height: auto; width: 100%; aspect-ratio: 3/2; } }
.card { min-width: 0; background: #fff; box-shadow: 0 2px 14px rgba(26,20,16,.07); display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; position: relative; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(26,20,16,.12); }
.card-img { aspect-ratio: 3/2; overflow: hidden; background: var(--mist); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--warm); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.card-title { font-family: var(--serif); font-weight: 600; font-size: 1.55rem; line-height: 1.15; margin: 0; text-wrap: balance; }
.card-title a { color: var(--deep); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-excerpt { color: var(--muted); font-size: .95rem; line-height: 1.65; margin: 0; }
.card-more { margin-top: auto; padding-top: 8px; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-dark); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 56px; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--mist); color: var(--deep); text-decoration: none; font-size: .9rem; }
.pagination .current, .pagination a:hover { background: var(--deep); color: var(--sand); border-color: var(--deep); }
.empty-note { text-align: center; color: var(--muted); padding: 40px 0; }

/* ===== Single post ===== */
.post-header { background: var(--deep); color: var(--sand); padding: 56px 0 0; }
.breadcrumbs { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(245,237,224,.6); margin-bottom: 22px; }
.breadcrumbs a { color: rgba(245,237,224,.75); text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs span[aria-hidden] { margin: 0 8px; color: var(--gold); }
.post-header h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.3rem, 5.2vw, 3.8rem); line-height: 1.06; margin: 0 0 20px; color: var(--sand); text-wrap: balance; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(245,237,224,.65); padding-bottom: 40px; }
.post-meta a { color: var(--gold); text-decoration: none; }
.post-hero-img { margin: 0 auto -1px; width: min(1000px, 100% - 40px); aspect-ratio: 16/9; overflow: hidden; position: relative; top: 0; }
.post-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.post-header.has-image { padding-bottom: 0; }
.post-header.has-image + .post-content-wrap { padding-top: 56px; }
.post-content-wrap { padding: 56px 0 24px; }

.entry-content > * { width: min(var(--measure), 100% - 40px); margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { width: min(var(--wide), 100% - 40px); }
.entry-content > .alignfull { width: 100%; }
.entry-content > * + * { margin-top: 1.3em; }
.entry-content p { margin-bottom: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: var(--serif); color: var(--deep); line-height: 1.15; margin-top: 2em; margin-bottom: .4em; text-wrap: balance; }
.entry-content h2 { font-size: 2.2rem; font-weight: 400; }
.entry-content h3 { font-size: 1.75rem; font-weight: 600; }
.entry-content h4 { font-size: 1.35rem; font-weight: 600; }
.entry-content strong { font-weight: 500; color: var(--deep); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: .45em; }
.entry-content li::marker { color: var(--gold-dark); }
.entry-content blockquote, .wp-block-quote { border-left: 3px solid var(--gold); padding: 6px 0 6px 26px; font-family: var(--serif); font-size: 1.5rem; line-height: 1.4; color: var(--deep); font-style: italic; }
.entry-content blockquote cite { display: block; font-family: var(--sans); font-style: normal; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.entry-content figure { margin-bottom: 0; }
.entry-content figcaption, .entry-content .caption, .wp-element-caption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 10px; }
.entry-content .wp-block-image img { width: 100%; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--mist); padding: 10px 12px; text-align: left; }
.entry-content th { font-weight: 500; background: var(--sand); }
.wp-block-table { overflow-x: auto; }

/* Galleries: neat grid instead of a long stack of photos */
.entry-content .wp-block-gallery { width: min(1000px, 100% - 40px); display: grid !important; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 230px; grid-auto-flow: dense; gap: 10px; }
.entry-content .wp-block-gallery figure.wp-block-image { margin: 0 !important; width: auto !important; height: 100% !important; min-height: 0; overflow: hidden; display: block !important; }
.entry-content .wp-block-gallery figure.wp-block-image img { display: block; width: 100% !important; max-width: 100% !important; height: 100% !important; object-fit: cover; }
.entry-content .wp-block-gallery figure.wp-block-image:first-child:nth-last-child(n+4) { grid-column: span 2; grid-row: span 2; }
/* Stretch the last photo so the grid never ends with an empty gap */
@media (min-width: 641px) { .entry-content .wp-block-gallery figure.wp-block-image:first-child:nth-last-child(3n+5) ~ figure:last-child { grid-column: span 2; } .entry-content .wp-block-gallery figure.wp-block-image:first-child:nth-last-child(3n+4) ~ figure:last-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .entry-content .wp-block-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; } .entry-content .wp-block-gallery figure.wp-block-image:first-child:nth-last-child(n+4) { grid-column: span 2; grid-row: span 2; } .entry-content .wp-block-gallery figure.wp-block-image:first-child:nth-last-child(2n+4) ~ figure:last-child, .entry-content .wp-block-gallery figure.wp-block-image:first-child:nth-last-child(3) ~ figure:last-child { grid-column: 1 / -1; } }

/* Buttons */
.wp-block-button__link, .btn { display: inline-block; background: var(--gold); color: var(--deep); border: 0; border-radius: 0; padding: 14px 28px; font-family: var(--sans); font-size: .78rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; transition: background .2s; }
.wp-block-button__link:hover, .btn:hover { background: #d8b85b; color: var(--deep); }
.is-style-outline .wp-block-button__link, .btn-outline { background: transparent; color: var(--deep); border: 1px solid var(--deep); }
.btn-light-outline { background: transparent; color: var(--gold); border: 1px solid var(--gold); }

/* ===== Design patterns the team can drop in ===== */
.mbv-callout { background: var(--sand); border-left: 3px solid var(--gold); padding: 26px 30px !important; }
.mbv-callout > * + * { margin-top: .7em; }
.mbv-callout .eyebrow { margin-bottom: 4px; }
.mbv-cta { background: var(--deep); color: var(--sand); padding: 48px 40px !important; text-align: center; }
.mbv-cta h2, .mbv-cta h3 { color: var(--sand) !important; margin-top: 0 !important; }
.mbv-cta p { color: rgba(245,237,224,.75); }
.mbv-spotlight { background: #fff; box-shadow: 0 2px 14px rgba(26,20,16,.07); }
.mbv-faq details { border-bottom: 1px solid var(--mist); padding: 16px 0; }
.mbv-faq summary { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--deep); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.mbv-faq summary::after { content: "+"; color: var(--gold-dark); font-family: var(--sans); font-weight: 300; }
.mbv-faq details[open] summary::after { content: "–"; }
.mbv-faq summary::-webkit-details-marker { display: none; }
.mbv-faq details > *:not(summary) { margin-top: 10px; }
.mbv-keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--mist); border: 1px solid var(--mist); }
.mbv-keyfacts > * { background: #fff; padding: 18px 20px; margin: 0 !important; }
.mbv-keyfacts strong { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--deep); line-height: 1.2; }

/* Key takeaways summary box (great for AI answers) */
.mbv-takeaways { border: 1px solid var(--gold); padding: 24px 28px !important; }
.mbv-takeaways h2, .mbv-takeaways h3 { margin-top: 0 !important; font-size: 1.5rem; }

/* ===== Post footer: author, tags, CTA, related ===== */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { background: var(--sand); color: var(--warm); text-decoration: none; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px; }
.post-tags a:hover { background: var(--gold); color: var(--deep); }
.author-box { display: flex; gap: 18px; align-items: center; border-top: 1px solid var(--mist); border-bottom: 1px solid var(--mist); padding: 24px 0; }
.author-box img { border-radius: 50%; width: 64px; height: 64px; }
.author-box .name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--deep); }
.author-box p { margin: 2px 0 0; font-size: .92rem; color: var(--muted); }
.post-footer { padding: 8px 0 24px; }
.post-footer > * + * { margin-top: 32px; }
.villa-cta { background: var(--deep); color: var(--sand); margin-top: 64px; padding: 64px 0; text-align: center; position: relative; overflow: hidden; }
.villa-cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 90% at 50% 120%, rgba(44,95,110,.55), transparent 65%); }
.villa-cta .wrap { position: relative; }
.villa-cta h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.1; margin: 0 0 12px; color: var(--sand); }
.villa-cta h2 em { color: var(--gold); }
.villa-cta p { color: rgba(245,237,224,.72); max-width: 52ch; margin: 0 auto 26px; }
.villa-cta .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.related { padding: 64px 0 80px; }
.related > .wrap > h2 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; color: var(--deep); margin: 0 0 28px; }

/* ===== Footer ===== */
.site-footer { background: var(--deep); color: rgba(245,237,224,.6); padding: 56px 0 36px; font-size: .9rem; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.site-footer h3 { font-family: var(--sans); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 400; margin: 0 0 12px; }
.site-footer a { color: #e9dfcc; text-decoration: none; display: block; margin: 6px 0; }
.site-footer a:hover { color: var(--gold); }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.08); margin-top: 36px; padding-top: 20px; font-size: .78rem; }

/* ===== Search & 404 ===== */
.search-form { display: flex; gap: 8px; max-width: 460px; }
.search-form input[type=search] { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--mist); background: #fff; font: inherit; font-size: .95rem; }
.search-form button { background: var(--gold); border: 0; padding: 0 18px; font: inherit; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.blog-hero .search-form { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 600px) { body { font-size: 17px; } .entry-content h2 { font-size: 1.85rem; } .entry-content h3 { font-size: 1.5rem; } .mbv-cta { padding: 36px 22px !important; } }
.site-footer .footer-menu { list-style: none; margin: 0; padding: 0; }
.site-footer .brand { display: inline-block; }
.blog-hero .hero-intro p { margin: 0 0 10px; }
/* Logo (Appearance > Customize > Site Identity > Logo) */
.custom-logo-link { display: inline-flex; align-items: center; }
.site-header .custom-logo { max-height: 46px; width: auto; display: block; }
.site-footer .custom-logo { max-height: 56px; width: auto; display: block; margin-bottom: 12px; }
.site-footer .brand img { height: 40px; width: auto; display: block; }
.brand b { font-weight: 400; font-style: italic; }
@media (max-width: 560px) { .site-header .brand { font-size: 1.15rem; } }
