/* Shared styles for sections added when merging content from the old familyhouseafrica.com site.
   Uses the colour tokens each page already defines in :root (--void, --gold, --paper, --ink, --warm-white). */

/* Footer: three link columns + contact/social row */
.footer-links { grid-template-columns: repeat(3, 1fr); max-width: 820px; gap: 60px; }
.footer-contact { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 0 0 40px; padding-top: 28px; border-top: 1px solid rgba(var(--fg-rgb), 0.16); color: rgba(var(--fg-rgb), 0.72); font-size: 14px; }
.footer-contact a:hover { color: var(--gold); }
.footer-social { display: flex; gap: 10px; margin-left: auto; }
.footer-social a { display: grid; place-content: center; width: 40px; height: 40px; border: 1px solid rgba(var(--fg-rgb), 0.22); border-radius: 50%; color: var(--warm-white); transition: background 180ms ease, border-color 180ms ease, color 180ms ease; }
.footer-social a:hover { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.footer-social svg { width: 17px; height: 17px; display: block; }
@media (max-width: 720px) {
  .footer-links { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-social { margin-left: 0; }
}

/* Generic content blocks */
.x-section { max-width: 1280px; margin: 0 auto; padding: 40px clamp(24px, 6vw, 92px) 90px; }
.x-section-light { max-width: none; background: var(--paper); color: var(--ink); }
.x-section-light > * { max-width: 1280px; margin-left: auto; margin-right: auto; }
.x-section h2 { max-width: 820px; margin: 0 0 18px; font-size: clamp(30px, 3.6vw, 46px); font-weight: 900; line-height: 1.08; letter-spacing: -0.03em; }
.x-intro { max-width: 760px; margin: 0 0 40px; color: rgba(var(--fg-rgb), 0.68); font-size: 17px; line-height: 1.65; }
.x-section-light .x-intro { color: #4a443e; }
.x-prose { max-width: 760px; color: rgba(var(--fg-rgb), 0.72); font-size: 16.5px; line-height: 1.7; }
.x-prose p { margin: 0 0 18px; }
.x-section-light .x-prose { color: #4a443e; }

.x-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.x-grid-2 { grid-template-columns: repeat(2, 1fr); }
.x-grid-4 { grid-template-columns: repeat(4, 1fr); }
.x-card { display: flex; flex-direction: column; padding: 28px; background: var(--card); border: 1px solid rgba(var(--fg-rgb), 0.1); }
.x-section-light .x-card { background: #f6f1e8; border-color: rgba(25, 21, 18, 0.1); }
.x-card h3 { margin: 0 0 12px; font-size: 20px; line-height: 1.15; letter-spacing: -0.02em; }
.x-card p { margin: 0 0 12px; color: rgba(var(--fg-rgb), 0.62); font-size: 14.5px; line-height: 1.6; }
.x-section-light .x-card p { color: #4a443e; }
.x-card .x-kicker { display: block; margin-bottom: 12px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.x-card .x-price { display: block; margin: 4px 0 14px; font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }
.x-card ul { margin: 0 0 18px; padding-left: 18px; color: rgba(var(--fg-rgb), 0.7); font-size: 14.5px; line-height: 1.75; }
.x-section-light .x-card ul { color: #4a443e; }
.x-card .x-link { margin-top: auto; color: var(--gold); font-weight: 700; font-size: 13px; }
.x-card .x-link:hover { text-decoration: underline; }
.x-card-featured { border-color: rgba(251, 46, 1, 0.5); background: var(--card-strong); }

.x-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.x-list li { padding: 18px 22px; background: var(--card); border: 1px solid rgba(var(--fg-rgb), 0.1); color: rgba(var(--fg-rgb), 0.75); font-size: 15px; line-height: 1.6; }
.x-section-light .x-list li { background: #f6f1e8; border-color: rgba(25, 21, 18, 0.1); color: #4a443e; }
.x-list li strong { color: var(--warm-white); }
.x-section-light .x-list li strong { color: var(--ink); }

/* Testimonials */
.x-quotes { columns: 3 320px; column-gap: 18px; }
.x-quote { break-inside: avoid; margin: 0 0 18px; padding: 28px; background: var(--card); border: 1px solid rgba(var(--fg-rgb), 0.1); }
.x-section-light .x-quote { background: #f6f1e8; border-color: rgba(25, 21, 18, 0.1); }
.x-quote p { margin: 0 0 12px; color: rgba(var(--fg-rgb), 0.78); font-size: 15px; line-height: 1.65; }
.x-section-light .x-quote p { color: #3b352f; }
.x-quote cite { display: block; margin-top: 14px; color: var(--gold); font-style: normal; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.x-quote cite span { display: block; margin-top: 3px; color: rgba(var(--fg-rgb), 0.45); font-weight: 600; }
.x-section-light .x-quote cite span { color: #7e7266; }
.x-tag { display: inline-block; margin: 0 0 22px; padding: 6px 12px; border: 1px solid rgba(251, 46, 1, 0.5); color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }

/* FAQ */
.x-faq { display: grid; gap: 10px; max-width: 900px; }
.x-faq details { background: var(--card); border: 1px solid rgba(var(--fg-rgb), 0.1); }
.x-section-light .x-faq details { background: #f6f1e8; border-color: rgba(25, 21, 18, 0.1); }
.x-faq summary { cursor: pointer; padding: 20px 24px; font-weight: 700; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.x-faq summary::-webkit-details-marker { display: none; }
.x-faq summary::after { content: "+"; color: var(--gold); font-size: 20px; line-height: 1; }
.x-faq details[open] summary::after { content: "–"; }
.x-faq details p { margin: 0; padding: 0 24px 22px; color: rgba(var(--fg-rgb), 0.68); font-size: 15px; line-height: 1.65; }
.x-section-light .x-faq details p { color: #4a443e; }

/* Stats + logos */
.x-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.x-stat { padding: 26px; border-top: 2px solid var(--gold); }
.x-stat b { display: block; font-size: clamp(34px, 4vw, 52px); font-weight: 900; letter-spacing: -0.03em; }
.x-stat span { display: block; margin-top: 10px; color: rgba(var(--fg-rgb), 0.62); font-size: 14px; line-height: 1.55; }
.x-section-light .x-stat span { color: #4a443e; }
.x-logos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.x-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 26px 20px; background: #fff; border: 1px solid rgba(25, 21, 18, 0.1); text-align: center; color: #3b352f; font-size: 13px; font-weight: 700; }
.x-logo img { max-height: 64px; width: auto; object-fit: contain; }

/* Gallery */
.x-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.x-gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--card); }
.x-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.x-gallery a:hover img { transform: scale(1.04); }
.x-lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 30px; background: rgba(var(--bg-rgb), 0.95); }
.x-lightbox.is-open { display: grid; }
.x-lightbox img { max-width: 100%; max-height: 86vh; }
.x-lightbox button { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border: 1px solid rgba(var(--fg-rgb), 0.3); border-radius: 50%; background: transparent; color: var(--warm-white); font-size: 22px; cursor: pointer; }

/* Blog list */
.x-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.x-post { display: flex; flex-direction: column; padding: 26px; background: var(--card); border: 1px solid rgba(var(--fg-rgb), 0.1); transition: border-color 180ms ease, background 180ms ease; }
.x-post:hover { border-color: rgba(251, 46, 1, 0.5); background: var(--card-strong); }
.x-post time { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.x-post h3 { margin: 12px 0 14px; font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; }
.x-post span { margin-top: auto; color: rgba(var(--fg-rgb), 0.55); font-size: 13px; font-weight: 700; }

.x-post img { width: calc(100% + 52px); max-width: none; margin: -26px -26px 20px; aspect-ratio: 16 / 9; object-fit: cover; }

/* Blog article */
.x-article { max-width: 780px; margin: 0 auto; padding: 70px clamp(24px, 6vw, 40px) 100px; }
.x-article-back { display: inline-block; margin-bottom: 34px; color: rgba(var(--fg-rgb), 0.6); font-size: 13px; font-weight: 700; }
.x-article-back:hover { color: var(--gold); }
.x-article h1 { margin: 0 0 20px; font-size: clamp(32px, 4.6vw, 54px); font-weight: 900; line-height: 1.05; letter-spacing: -0.03em; }
.x-article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.x-article-tags span { padding: 5px 10px; border: 1px solid rgba(var(--fg-rgb), 0.2); color: rgba(var(--fg-rgb), 0.6); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.x-article-hero { width: 100%; margin: 0 0 40px; aspect-ratio: 16 / 9; object-fit: cover; }
.x-article-body { color: rgba(var(--fg-rgb), 0.8); font-size: 18px; line-height: 1.75; }
.x-article-body p { margin: 0 0 22px; }
.x-article-body h2, .x-article-body h3, .x-article-body h4 { margin: 40px 0 16px; color: var(--warm-white); line-height: 1.2; letter-spacing: -0.02em; }
.x-article-body strong { color: var(--warm-white); }
.x-article-body a { color: var(--gold); text-decoration: underline; }
.x-article-body ul, .x-article-body ol { margin: 0 0 22px; padding-left: 24px; }
.x-article-body li { margin-bottom: 8px; }
.x-article-body img, .x-article-body iframe { max-width: 100%; height: auto; margin: 10px 0 24px; }
.x-article-body blockquote { margin: 0 0 22px; padding-left: 20px; border-left: 3px solid var(--gold); font-style: italic; }

/* Book chapter list */
.x-chapters { columns: 2 280px; column-gap: 40px; margin: 0; padding-left: 0; list-style: none; }
.x-chapters li { break-inside: avoid; padding: 12px 0; border-bottom: 1px solid rgba(var(--fg-rgb), 0.12); color: rgba(var(--fg-rgb), 0.78); }
.x-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.x-buttons a { padding: 12px 18px; border: 1px solid rgba(var(--fg-rgb), 0.25); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.x-buttons a:hover { border-color: var(--gold); color: var(--gold); }

@media (max-width: 1100px) {
  .x-grid, .x-grid-4, .x-posts { grid-template-columns: 1fr 1fr; }
  .x-stats, .x-logos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .x-grid, .x-grid-2, .x-grid-4, .x-posts { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .x-stats, .x-logos { grid-template-columns: 1fr; }
}

/* ---------- Light / dark theme ---------- */
.theme-toggle { display: grid; place-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(var(--fg-rgb), 0.22); border-radius: 50%; background: transparent; color: var(--warm-white); cursor: pointer; transition: background 180ms ease, color 180ms ease, border-color 180ms ease; }
.theme-toggle:hover { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

html[data-theme="light"] {
  color-scheme: light;
  --void: #faf8f4; --carbon: #f1ece4; --warm-white: #191512; --stone: #6b645c;
  --gold: #d92800; --gold-light: #f03a10;
  --fg-rgb: 25, 21, 18; --bg-rgb: 250, 248, 244;
  --card: #ffffff; --card-strong: #fff3ee; --bg-alt: #f2eee6;
}
/* These stay dark in both themes: the homepage video hero, the footer and dark buttons on orange sections */
html[data-theme="light"] .hero,
html[data-theme="light"] .site-footer,
html[data-theme="light"] .cta-dark,
html[data-theme="light"] .sound-invitation,
html[data-theme="light"] .sound-control {
  --void: #090807; --carbon: #0c0b0a; --warm-white: #f4f0e8; --stone: #a6a19a;
  --gold: #fb2e01; --gold-light: #ff5833;
  --fg-rgb: 244, 240, 232; --bg-rgb: 9, 8, 7;
  --card: #14110d; --card-strong: #191009; --bg-alt: #12100f;
  color-scheme: dark;
}
html[data-theme="light"] .site-footer { background: #0c0b0a; }
html[data-theme="light"] .x-gallery a, html[data-theme="light"] .x-card, html[data-theme="light"] .x-post, html[data-theme="light"] .x-quote { box-shadow: 0 1px 2px rgba(25, 21, 18, 0.04); }