/*
Theme Name: Apple Oaks Modern
Theme URI: https://localhost:8443
Author: Apple Oaks Carpentry
Description: Modern, sleek red & black theme for AppleOaks carpentry and plastering — Dover, Kent. Built as a standalone switchable theme; pairs with Contact Form 7.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: apple-oaks-modern
*/

/* ---------- Design tokens ---------- */
:root {
  --black: #0a0a0b;
  --ink: #121215;
  --card-dark: #17171b;
  --line-dark: rgba(255, 255, 255, 0.08);
  --red: #e02434;
  --red-deep: #a90f1d;
  --paper: #f6f5f3;
  --white: #ffffff;
  --text-dark: #1a1a1c;
  --text-mute-dark: #6b6b70;
  --text-light: #f4f4f2;
  --text-mute-light: #a3a3a8;
  --font-head: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.35);
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-dark);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 0.6em; letter-spacing: -0.02em; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Kicker label */
.kicker {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-head); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--red);
}
.kicker::before { content: ""; width: 2.2rem; height: 2px; background: var(--red); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.95rem 1.9rem; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 12px 30px -12px rgba(224, 36, 52, 0.7); }
.btn-red:hover { background: var(--red-deep); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  background: linear-gradient(rgba(6, 6, 8, 0.75), rgba(6, 6, 8, 0));
}
.site-header.is-scrolled {
  background: rgba(9, 9, 11, 0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line-dark);
}
/* backdrop-filter makes the header the containing block for the fixed
   mobile menu overlay, clipping it to the bar — disable it while open */
body.nav-open .site-header {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: rgba(9, 9, 11, 0.97);
}
.header-inner { display: flex; align-items: center; gap: 2rem; padding: 1.05rem 0; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: #fff; line-height: 1.1; }
.brand-mark { width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.28rem; letter-spacing: -0.01em; }
.brand-name em { font-style: normal; color: var(--red); }
.brand-tag { font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-mute-light); margin-top: 2px; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 1.9rem; }
.main-nav a {
  color: #e8e8ea; text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 0.25rem 0; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.main-nav a:hover { color: #fff; border-color: var(--red); }
.nav-cta { margin-left: 0.4rem; }
.nav-cta .btn { padding: 0.6rem 1.3rem; font-size: 0.85rem; }
.nav-facebook { display: none; } /* mobile menu only */
@media (max-width: 880px) {
  .nav-facebook { display: block; }
  .nav-facebook .btn { font-size: 0.95rem; padding: 1rem 2.2rem; }
}
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 0.5rem;
  position: relative; z-index: 110; /* stay above (and clickable over) the fixed menu overlay */
}
.nav-toggle span { display: block; width: 26px; height: 2px; background: #fff; margin: 6px 0; border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 0; background: #08080a;
    flex-direction: column; justify-content: center; gap: 2.2rem;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  }
  .nav-open .main-nav { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.25s ease; }
  .main-nav a { font-size: 1.4rem; }
}

/* ---------- Hero ---------- */
.hero { position: relative; display: flex; align-items: center; color: #fff; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(7, 7, 9, 0.94) 20%, rgba(7, 7, 9, 0.55) 55%, rgba(7, 7, 9, 0.35) 100%),
    linear-gradient(rgba(7, 7, 9, 0.2), rgba(7, 7, 9, 0.65) 90%);
}
.hero-inner { position: relative; z-index: 1; padding: 7.5rem 0 4rem; max-width: 720px; }
@media (max-width: 880px) {
  .hero-inner { padding: 6.5rem 0 3rem; }
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.3rem); font-weight: 700; margin: 1.1rem 0 1.2rem; color: #fff;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #d6d6d9; max-width: 34rem; margin: 0 0 2.2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 2.4rem; border-top: 1px solid var(--line-dark); padding-top: 1.8rem; }
.trust-item strong { display: block; font-family: var(--font-head); font-size: 1.5rem; color: #fff; }
.trust-item span { font-size: 0.85rem; color: var(--text-mute-light); }

/* Red ticker strip */
.ticker { background: var(--red); color: #fff; overflow: hidden; padding: 0.8rem 0; }
.ticker-track { display: flex; gap: 3rem; white-space: nowrap; animation: ticker 30s linear infinite; width: max-content; }
.ticker-track span { font-family: var(--font-head); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 3rem; }
.ticker-track span::after { content: "◆"; font-size: 0.55rem; opacity: 0.7; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Sections ---------- */
.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.section-head p { color: var(--text-mute-dark); margin: 0; }
.section-light { background: var(--paper); color: var(--text-dark); }
.section-dark { background: var(--ink); color: var(--text-light); }
.section-dark .section-head p { color: var(--text-mute-light); }
.section-black { background: var(--black); color: var(--text-light); }
.section-black .section-head p { color: var(--text-mute-light); }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.1rem; }
.service-card {
  background: var(--white); border: 1px solid #e7e5e1; border-radius: var(--radius);
  padding: 1.7rem 1.5rem 1.6rem; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.service-icon {
  width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, var(--red), var(--red-deep));
  display: grid; place-items: center; margin-bottom: 1.1rem; color: #fff;
}
.service-icon svg { width: 22px; height: 22px; }
.service-card h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.service-card p { font-size: 0.92rem; color: var(--text-mute-dark); margin: 0; line-height: 1.55; }

/* ---------- Featured work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.work-card {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 4.6;
  background: var(--card-dark);
}
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.work-card:hover img { transform: scale(1.05); }
.work-card figcaption {
  position: absolute; inset: auto 0 0 0; padding: 2.2rem 1.4rem 1.3rem;
  background: linear-gradient(transparent, rgba(5, 5, 7, 0.88));
  font-family: var(--font-head); font-weight: 600; color: #fff; font-size: 1.02rem;
}
.work-card figcaption small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--text-mute-light); font-size: 0.82rem; margin-top: 2px; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.8rem; }
.gallery-grid a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease, filter 0.45s ease; }
.gallery-grid a:hover img { transform: scale(1.07); filter: brightness(1.08); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(5, 5, 7, 0.94);
  display: none; align-items: center; justify-content: center; padding: 4vmin;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; width: auto; height: auto; border-radius: 10px; box-shadow: var(--shadow); }
.lightbox-close {
  position: absolute; top: 1.2rem; right: 1.4rem; background: none; border: 0; color: #fff;
  font-size: 2.2rem; line-height: 1; cursor: pointer; opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* ---------- Testimonials ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.2rem; }
.quote-card {
  background: var(--white); border-radius: var(--radius); padding: 2rem 1.7rem;
  border: 1px solid #e7e5e1; position: relative;
}
.quote-card::before {
  content: "“"; position: absolute; top: 0.4rem; right: 1.2rem;
  font-family: var(--font-head); font-size: 4.4rem; color: rgba(224, 36, 52, 0.16); line-height: 1;
}
.quote-stars { color: var(--red); letter-spacing: 0.18em; font-size: 0.8rem; margin-bottom: 0.9rem; }
.quote-card blockquote { margin: 0 0 1.2rem; font-size: 0.98rem; line-height: 1.6; }
.quote-card cite { font-style: normal; font-family: var(--font-head); font-weight: 600; font-size: 0.88rem; }
.quote-card cite span { display: block; font-family: var(--font-body); font-weight: 400; color: var(--text-mute-dark); font-size: 0.8rem; }

/* ---------- About / why us ---------- */
.about-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.check-list { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.check-list li { display: flex; gap: 0.75rem; align-items: baseline; font-size: 0.98rem; }
.check-list li::before { content: "✓"; color: var(--red); font-weight: 700; flex: 0 0 auto; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.4rem; }
.contact-info-list li { display: flex; gap: 1rem; align-items: flex-start; }
.contact-info-list .ci-icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; background: rgba(224, 36, 52, 0.14);
  color: var(--red); display: grid; place-items: center;
}
.contact-info-list .ci-icon svg { width: 20px; height: 20px; }
.contact-info-list strong { display: block; font-family: var(--font-head); font-size: 0.92rem; }
.contact-info-list a { color: var(--text-mute-light); text-decoration: none; }
.contact-info-list a:hover { color: #fff; }
.contact-info-list span { color: var(--text-mute-light); font-size: 0.95rem; }

/* CF7 form styling */
.contact-form-panel {
  background: var(--card-dark); border: 1px solid var(--line-dark); border-radius: var(--radius);
  padding: clamp(1.6rem, 3.5vw, 2.6rem);
}
.contact-form-panel h3 { font-size: 1.35rem; }
.wpcf7 p { margin: 0 0 1rem; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"],
.wpcf7 select, .wpcf7 textarea {
  width: 100%; padding: 0.9rem 1.05rem; border-radius: 10px;
  background: #101014; border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text-light);
  font: inherit; font-size: 0.98rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.wpcf7 select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a3a3a8' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; }
.wpcf7 input::placeholder, .wpcf7 textarea::placeholder { color: #7c7c82; }
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 36, 52, 0.22);
}
.wpcf7 textarea { min-height: 140px; resize: vertical; }
.wpcf7 input[type="submit"] {
  width: 100%; padding: 1rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--red); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  transition: background 0.2s, transform 0.2s; box-shadow: 0 12px 30px -12px rgba(224, 36, 52, 0.7);
}
.wpcf7 input[type="submit"]:hover { background: var(--red-deep); transform: translateY(-2px); }
.wpcf7 .wpcf7-spinner { display: block; margin: 0.5rem auto 0; }
.wpcf7 .wpcf7-not-valid-tip { color: #ff8a94; font-size: 0.82rem; margin-top: 0.35rem; }
.wpcf7 .wpcf7-response-output {
  margin: 1rem 0 0; padding: 0.85rem 1.1rem; border-radius: 10px;
  border: 1px solid var(--red); font-size: 0.92rem;
}
.wpcf7 form.sent .wpcf7-response-output { border-color: #2e9e5b; background: rgba(46, 158, 91, 0.12); }

/* ---------- Footer ---------- */
.site-footer { background: #060608; color: var(--text-mute-light); padding: 3.2rem 0 2.4rem; }
.footer-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.footer-nav a { color: var(--text-mute-light); text-decoration: none; font-size: 0.92rem; }
.footer-nav a:hover { color: #fff; }
.btn-facebook {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.7rem; border-radius: 999px;
  background: #1877f2; color: #fff; text-decoration: none;
  font-family: var(--font-head); font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 12px 30px -14px rgba(24, 119, 242, 0.8);
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-facebook:hover { background: #0e63d3; transform: translateY(-2px); }
.footer-legal { border-top: 1px solid var(--line-dark); padding-top: 1.6rem; font-size: 0.84rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* Back to top */
.to-top {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 90; width: 46px; height: 46px;
  border-radius: 50%; border: 0; cursor: pointer; background: var(--red); color: #fff; font-size: 1.15rem;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  transform: translateY(8px);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
/* Keep clear of the captcha/badge widget that sits bottom-right on mobile */
@media (max-width: 880px) {
  .to-top { bottom: 5.5rem; }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Inner pages (page.php / index.php) ---------- */
.page-hero { background: var(--ink); color: #fff; padding: 9rem 0 3.5rem; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0.8rem 0 0; }
.page-body { background: var(--paper); padding: clamp(3rem, 6vw, 5rem) 0; }
.prose { max-width: 760px; }
.prose a { color: var(--red-deep); }
.prose h2, .prose h3 { margin-top: 2em; }

/* Admin bar offset */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
