/*
Theme Name: Davinci Reservoir
Theme URI: https://davincireservoir.com
Author: Davinci Reservoir
Author URI: https://davincireservoir.com
Description: A hand-coded, elegant dark theme for Davinci Reservoir — professional hydraulic systems training for tradespeople. Built without page builders for a fast, lightweight site.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: davinci-reservoir
*/

/* ===========================================================
   Davinci Reservoir — elegant dark theme
   =========================================================== */

:root {
  /* Palette */
  --bg:        #0d0e10;
  --bg-alt:    #121316;
  --surface:   #17181c;
  --surface-2: #1d1f24;
  --line:      #2a2c32;
  --text:      #f3f1ea;
  --muted:     #a2a4ad;
  --muted-2:   #74767e;

  /* Warm gold accent */
  --gold:      #c9a24b;
  --gold-soft: #d9b96f;
  --gold-deep: #a07f33;

  /* Type */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Layout */
  --maxw: 1140px;
  --radius: 14px;
  --gap: 28px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn-lg { padding: 15px 30px; font-size: 1rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  color: #1a1407;
  box-shadow: 0 8px 24px -10px rgba(201,162,75,.6);
}
.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13,14,16,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand-mark { color: var(--gold); display: inline-flex; }
.brand-text { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; letter-spacing: .01em; }
.brand-accent { color: var(--gold); margin-left: 2px; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { color: var(--muted); font-size: 0.95rem; font-weight: 500; transition: color .18s ease; }
.nav a:hover { color: var(--text); }
.nav-cta { color: #1a1407 !important; }
.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 30px; }
.nav-menu li { margin: 0; position: relative; }
.nav-menu > li { display: flex; align-items: center; height: 72px; }
.nav-menu .current-menu-item > a { color: var(--text); }

/* Sub-menus (dropdowns) */
.menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .6;
}
.nav-menu .sub-menu {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 48px -24px rgba(0,0,0,.75);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 60;
}
.nav-menu .menu-item-has-children:hover > .sub-menu,
.nav-menu .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-menu .sub-menu .sub-menu { top: -9px; left: 100%; }
.nav-menu .sub-menu li { width: 100%; height: auto; }
.nav-menu .sub-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  white-space: nowrap;
}
.nav-menu .sub-menu a:hover { background: var(--surface-2); color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text); margin: 0 auto;
  transition: transform .25s ease, opacity .25s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: calc(100vh - 72px); /* fill the first screen below the 72px header */
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding: 60px 0 24px;
  overflow: hidden;
  text-align: center;
  background-color: var(--bg);
  background-image: url("img/hero-background.webp");
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
}
.hero-glow {
  position: absolute;
  top: -180px; left: 50%;
  width: 900px; height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(201,162,75,.18), transparent 65%);
  pointer-events: none;
}
.hero-inner {
  position: absolute;
  top: 35%;
  left: 0;
  right: 0;
  max-width: 820px;
  margin: 0 auto;
}

/* Keep the outline button readable over the lighter hero image */
.hero .btn-ghost {
  background: rgba(13,14,16,.4);
  backdrop-filter: blur(6px);
  border-color: rgba(243,241,234,.45);
}
.hero .btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 12px;
  text-shadow: 0 2px 24px rgba(0,0,0,.55);
}
.hero-sub {
  font-size: 0.98rem;
  color: #e7e5dd;
  max-width: 480px;
  margin: 0 auto 24px;
  text-shadow: 0 1px 16px rgba(0,0,0,.6);
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin: 64px 0 0;
  flex-wrap: wrap;
}
.hero-stats div { text-align: center; }
.hero-stats dt {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--gold-soft);
  line-height: 1;
}
.hero-stats dd { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); letter-spacing: .02em; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 14px; }
.section-lead { color: var(--muted); font-size: 1.08rem; }

.section-foot { text-align: center; margin-top: 48px; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Cards (value props) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(201,162,75,.4); }
.card-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border-radius: 12px;
  background: rgba(201,162,75,.1);
  color: var(--gold-soft);
  margin-bottom: 20px;
}
.card h3 { font-size: 1.35rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.98rem; }

/* ---------- Course cards ---------- */
.course-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.course-card:hover { transform: translateY(-4px); border-color: rgba(201,162,75,.45); background: var(--surface-2); }
.course-tag {
  align-self: flex-start;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-soft);
  background: rgba(201,162,75,.1);
  border: 1px solid rgba(201,162,75,.25);
  padding: 5px 12px; border-radius: 999px;
  margin-bottom: 18px;
}
.course-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.course-card p { color: var(--muted); font-size: 0.96rem; flex: 1; }
.course-meta { margin-top: 20px; font-size: 0.84rem; color: var(--muted-2); font-weight: 500; }

.course-card-more {
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(160deg, rgba(201,162,75,.08), transparent);
  border-style: dashed;
}
.course-card-more h3 { color: var(--gold-soft); }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  counter-reset: step;
}
.step {
  padding: 32px;
  border-left: 1px solid var(--line);
}
.step-num {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--gold);
  opacity: .55;
  display: block;
  margin-bottom: 12px;
}
.step h3 { font-size: 1.35rem; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 0.98rem; }

/* ---------- Blog ---------- */
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(201,162,75,.4); }
.post-thumb {
  height: 170px;
  background:
    linear-gradient(135deg, rgba(201,162,75,.22), rgba(201,162,75,.04)),
    var(--surface-2);
  position: relative;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb::after {
  content: attr(data-cat);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.4rem;
  color: rgba(243,241,234,.18);
  letter-spacing: .05em;
}
.post-body { padding: 24px; }
.post-cat {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-soft);
}
.post-card h3 { font-size: 1.22rem; margin: 10px 0; }
.post-card h3 a:hover { color: var(--gold-soft); }
.post-body p { color: var(--muted); font-size: 0.95rem; }
.post-meta { display: block; margin-top: 16px; font-size: 0.82rem; color: var(--muted-2); }

/* Newsletter cards that open a DearFlip flipbook on click */
.post-card-dflip { cursor: pointer; }
.post-thumb-dflip {
  height: 240px;
  background: transparent;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.post-thumb-dflip::after { display: none; }
.post-thumb-dflip ._df_thumb {
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}

/* ---------- Newsletter ---------- */
.newsletter-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  background:
    radial-gradient(circle at 85% 15%, rgba(201,162,75,.16), transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 56px;
}
.newsletter-text h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 14px; }
.newsletter-text p { color: var(--muted); }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 12px; }
.newsletter-form input {
  flex: 1; min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  padding: 14px 20px;
  font-family: var(--sans); font-size: 1rem;
}
.newsletter-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,75,.15);
}
.form-note { flex-basis: 100%; font-size: 0.88rem; min-height: 1.2em; margin-top: 4px; }
.form-note.ok { color: var(--gold-soft); }
.form-note.err { color: #e57373; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding-top: 64px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 48px;
  padding-bottom: 48px;
}
.footer-brand .brand-text { font-size: 1.3rem; }
.footer-brand p { color: var(--muted); margin-top: 10px; font-size: 0.95rem; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-nav h4 {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 16px;
}
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin: 0; }
.footer-nav a { display: block; color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; transition: color .18s ease; }
.footer-nav a:hover { color: var(--gold-soft); }
.footer-bottom { border-top: 1px solid var(--line); padding: 24px; text-align: center; }
.footer-bottom p { color: var(--muted-2); font-size: 0.86rem; }

/* ---------- Page banner (Newsletter & inner pages) ---------- */
.page-banner { width: 100%; background: var(--bg); }
.page-banner img { display: block; width: 100%; height: auto; }

/* ---------- Reading width ---------- */
.container-narrow { max-width: 760px; }

/* ---------- Single post / newsletter article ---------- */
.post-header { text-align: center; max-width: 760px; margin: 0 auto 40px; }
.post-title { font-size: clamp(2rem, 4vw, 3rem); margin: 10px 0 14px; }
.post-header .post-meta { color: var(--muted-2); font-size: 0.9rem; }
.post-hero { margin: 0 0 40px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.post-hero img { width: 100%; height: auto; display: block; }

.post-content { color: var(--muted); font-size: 1.06rem; line-height: 1.8; }
.post-content > * + * { margin-top: 1.3em; }
.post-content h2 { font-size: 1.8rem; margin-top: 1.8em; color: var(--text); }
.post-content h3 { font-size: 1.4rem; margin-top: 1.6em; color: var(--text); }
.post-content a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--gold); }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li + li { margin-top: .5em; }
.post-content img { border-radius: var(--radius); height: auto; }
.post-content blockquote {
  margin: 1.6em 0; padding: 8px 0 8px 24px;
  border-left: 3px solid var(--gold);
  color: var(--text); font-family: var(--serif); font-size: 1.2rem; font-style: italic;
}
.post-content code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 0.92em;
}

/* ---------- Pagination ---------- */
.section-foot .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 12px; margin: 0 4px;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 0.95rem;
}
.section-foot .page-numbers.current { background: var(--gold); color: #1a1407; border-color: var(--gold); }
.section-foot a.page-numbers:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .steps { grid-template-columns: 1fr 1fr; }
  .newsletter-card { grid-template-columns: 1fr; padding: 40px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 24px;
    transform: translateY(-120%);
    transition: transform .3s ease;
  }
  .nav.open { transform: translateY(0); }
  .nav-menu { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-menu > li { height: auto; display: block; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: 14px; border-bottom: none !important; }
  .menu-item-has-children > a::after { float: right; margin-top: 8px; }
  .nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 0 16px;
    min-width: 0;
  }
  .nav-menu .sub-menu a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
  .nav-toggle { display: flex; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .grid-3, .steps { grid-template-columns: 1fr; }
  .step { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 24px; }
  .hero { padding: 80px 0 70px; }
  .hero-stats { gap: 36px; }
  .section { padding: 72px 0; }
}
