/*
Theme Name: DiscoverPubs
Theme URI: https://discoverpubs.com
Update URI: false
Author: Discover Publications
Author URI: https://discoverpubs.com
Description: Custom WordPress theme for DiscoverPubs.com — neighborhood real estate publications. Features customizable header, navigation, footer with social links, and the full DiscoverPubs design system.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
Text Domain: discoverpubs
*/

/* ============================================================
   DESIGN SYSTEM — CSS Custom Properties
   ============================================================ */
:root {
  /* Brand palette */
  --navy:   #0a2152;
  --teal:   #23505b;
  --sage:   #6a8674;
  --moss:   #a0a46f;
  --gold:   #f1cd84;

  /* Light mode surface */
  --bg:     #ffffff;
  --bg2:    #f6f7f8;
  --bg3:    #edf0f2;

  /* Light mode text */
  --ink:    #0d1a22;
  --ink2:   #2e3f4a;
  --ink3:   #6b7e88;
  --rule:   #dde3e8;

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-pill: 100px;

  /* Layout */
  --max:  1200px;
  --pad:  clamp(24px, 5vw, 80px);
}

/* Dark mode overrides */
[data-theme="dark"] {
  --bg:   #07111a;
  --bg2:  #0d1c26;
  --bg3:  #152433;
  --ink:  #e8f0f5;
  --ink2: #b8cdd8;
  --ink3: #5e7a88;
  --rule: #1e3040;
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Geomanist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }

/* ============================================================
   TYPOGRAPHY — Geomanist (self-hosted via @font-face in functions.php)
   ============================================================ */
.font-display { font-family: 'Playfair Display', Georgia, serif; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
section { padding: 96px 0; }

/* ============================================================
   EYEBROW / LABELS
   ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--moss);
}
.eyebrow.gold         { color: rgba(241,205,132,.75); }
.eyebrow.gold::before { background: rgba(241,205,132,.4); }
.eyebrow.muted        { color: var(--ink3); }
.eyebrow.muted::before{ background: var(--rule); }
.eyebrow.center       { justify-content: center; }

/* ============================================================
   HEADINGS
   ============================================================ */
h2.sh {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 3.8vw, 46px);
  font-weight: 900;
  line-height: 1.08;
  color: var(--ink);
  letter-spacing: -.5px;
  margin-bottom: 16px;
}
h2.sh em         { font-style: italic; color: var(--teal); }
h2.sh.white      { color: rgba(232,242,245,.95); }
h2.sh.white em   { color: rgba(241,205,132,.8); }
h2.sh.center     { text-align: center; }

/* ============================================================
   BODY TEXT
   ============================================================ */
p.bl {
  font-size: 17px;
  font-weight:400;
  line-height: 1.8;
  color: var(--ink3);
  max-width: 560px;
}
p.bl.white  { color: rgba(232,242,245,.55); }
p.bl.center { text-align: center; margin: 0 auto; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Geomanist, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  background: var(--gold);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.btn-gold:hover { background: #f5d898; transform: translateY(-1px); }

.btn-ghost-white {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,.65);
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
}
.btn-ghost-white:hover { color: white; border-color: white; }

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  height: 72px;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
#site-header.scrolled {
  background: rgba(255,255,255,.9);
  border-color: var(--rule);
  backdrop-filter: saturate(180%) blur(20px);
}
[data-theme="dark"] #site-header.scrolled {
  background: rgba(7,17,26,.92);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ── Logo — 3-variant switching ── */
.site-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 56px;
  min-width: 150px;
  position: relative;
}

/* All logo images hidden by default */
.site-logo {
  height: 56px;
  width: auto;
  display: none;
  transition: opacity .25s ease;
}

/* STATE 1 — transparent dark nav (not scrolled): show hero logo */
#site-header:not(.scrolled) .site-logo--hero  { display: block; }
#site-header:not(.scrolled) .site-logo--light { display: none; }
#site-header:not(.scrolled) .site-logo--dark  { display: none; }

/* STATE 2 — scrolled, light mode: show light logo */
#site-header.scrolled .site-logo--hero  { display: none; }
#site-header.scrolled .site-logo--light { display: block; }
#site-header.scrolled .site-logo--dark  { display: none; }

/* STATE 3 — scrolled, dark mode: show dark logo */
[data-theme="dark"] #site-header.scrolled .site-logo--light { display: none; }
[data-theme="dark"] #site-header.scrolled .site-logo--dark  { display: block; }

/* Fallback: if hero logo missing before scroll, show text */
/* Fallback: if light logo missing when scrolled in light mode, fall back to hero */
#site-header.scrolled .site-logo--light:not([src]) { display: none; }

/* Text fallback (used when no image logos are uploaded) */
.site-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: rgba(255,255,255,.95);
  transition: color .25s;
  white-space: nowrap;
  line-height: 56px;
}
.site-logo-text em { font-style: italic; color: var(--gold); }
#site-header.scrolled .site-logo-text            { color: var(--navy); }
#site-header.scrolled .site-logo-text em         { color: var(--teal); }
[data-theme="dark"] #site-header.scrolled .site-logo-text    { color: rgba(232,242,245,.95); }
[data-theme="dark"] #site-header.scrolled .site-logo-text em { color: var(--gold); }

/* Primary nav */
#primary-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex: 1;           /* takes all space between logo and CTA */
}
#primary-navigation a {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,.75);
  transition: color .2s;
  white-space: nowrap;
  letter-spacing: .1px;
}
#primary-navigation a:hover,
#primary-navigation .current-menu-item > a,
#primary-navigation .current-page-ancestor > a {
  color: white;
}
#site-header.scrolled #primary-navigation a { color: var(--ink3); }
#site-header.scrolled #primary-navigation a:hover,
#site-header.scrolled #primary-navigation .current-menu-item > a { color: var(--ink); }

/* Header CTA button */
.header-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy) !important;
  background: var(--gold);
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  transition: background .2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-cta:hover { background: #f5d898 !important; }

/* Hamburger */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
#site-header.scrolled .hamburger-btn {
  background: var(--bg3);
  border-color: var(--rule);
}
.hamburger-btn span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: rgba(255,255,255,.9);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
#site-header.scrolled .hamburger-btn span { background: var(--ink2); }
.hamburger-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
#mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 299;
  background: linear-gradient(160deg, var(--navy) 0%, var(--teal) 100%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
  display: none;
}
#mobile-menu.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  display: flex;
}
#mobile-menu a {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  padding: 16px 0;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
  width: 100%;
  max-width: 320px;
  transition: color .2s;
}
#mobile-menu a:hover { color: var(--gold); }
#mobile-menu .mobile-cta {
  margin-top: 32px;
  background: var(--gold);
  color: var(--navy) !important;
  padding: 14px 40px;
  border-radius: var(--radius-pill);
  font-family: Geomanist, sans-serif;
  font-weight: 600;
  font-size: 15px;
  border-bottom: none !important;
  display: inline-block;
}

@media (max-width: 860px) {
  #primary-navigation, .header-cta { display: none; }
  .hamburger-btn { display: flex; }
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: linear-gradient(160deg, var(--navy) 0%, var(--teal) 100%);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px var(--pad) 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 44px;
  padding-bottom: 20px;
  margin-bottom: 0;
}

/* Footer brand col */
.footer-logo-wrap { margin-bottom: 16px; }
.footer-logo-img  { height: 46px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.footer-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: white;
}
.footer-logo-text em { font-style: italic; color: var(--gold); }
.footer-tagline {
  font-size: 13px;
  font-weight:400;
  color: rgba(255,255,255,.5);
  line-height: 1.8;
  max-width: 260px;
  margin-bottom: 12px;
}
.footer-address {
  font-size: 13px;
  font-style: normal;
  line-height: 1.8;
  color: rgba(255,255,255,.35);
  font-weight:400;
  margin-bottom: 16px;
}

/* Social links — flat icons, no circle */
.footer-social {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.4);
  transition: color .2s, transform .15s;
  text-decoration: none;
  padding: 0;
}
.social-btn:hover {
  background: transparent;
  color: rgba(255,255,255,.9);
  transform: translateY(-2px);
}
.social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

/* Footer nav columns */
.footer-col h5 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 18px;
}
.footer-nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}
.footer-nav-links a {
  font-size: 14px;
  font-weight:400;
  color: rgba(255,255,255,.45);
  transition: color .2s;
  line-height: 1.4;
}
.footer-nav-links a:hover { color: var(--gold); }

/* Footer bottom bar */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 32px;
  font-size: 11px;
  color: rgba(255,255,255,.3);
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 0;
}
.footer-bottom a {
  color: rgba(255,255,255,.35);
  transition: color .2s;
}
.footer-bottom a:hover { color: rgba(255,255,255,.7); }
.footer-bottom-links { display: flex; gap: 14px; }

@media (max-width: 960px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .footer-bottom-links { gap: 12px; justify-content: center; }
  section { padding: 72px 0; }
}
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ============================================================
   DARK MODE DOCK — fixed bottom-right, slightly larger
   ============================================================ */
.theme-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  z-index: 200;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.theme-dock button {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  padding: 0 !important;
  margin: 0;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--ink3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  transition: background .2s;
  box-sizing: border-box;
}
.theme-dock button:hover { background: var(--bg3); }
/* Icons rendered as inline SVG in header.php */
/* ============================================================
   WORDPRESS CORE COMPATIBILITY
   ============================================================ */
.wp-block-image { margin: 0; }
.alignwide  { max-width: calc(var(--max) + 120px); margin-left: auto; margin-right: auto; }
.alignfull  { width: 100%; max-width: none; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal !important;
}

/* ── Back to top — sits inside .theme-dock flex row ── */
#back-to-top {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--rule);
  color: var(--ink3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s, transform .25s, background .2s;
  pointer-events: none;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  background: var(--bg3);
  color: var(--ink);
  transform: scale(1.06);
}
#back-to-top svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
