/*
Theme Name: DSD Mozilla Mirror Pro
Theme URI: https://digitalsportsdaily.com/
Author: ChatGPT
Description: A WordPress theme closely inspired by Mozilla Foundation styling (sticky nav, Zilla Slab headings, Nunito Sans body, bold uppercase navigation, generous whitespace, thick underlines, two-tone divider bar, left widget sidebar).
Version: 1.4.1
License: GPLv2 or later
Text Domain: dsd-mozilla-mirror-pro
*/

:root{
  --container: 1180px;
  --gutter: 24px;

  --text: #0b0b0b;
  --muted: #555;
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e7e7e7;

  --accent: #000000;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.06);

  --underline: 3px;
  --underline-hover: 4px;

  /* Divider (customizable via Customizer) */
  --dsdmmpro-divider-color: #ff8a3d;
  --dsdmmpro-divider-height: 12px;
  --dsdmmpro-divider-topline: rgba(0,0,0,0.18);
  --dsdmmpro-divider-topline-height: 2px;
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  color:var(--text);
  background:var(--bg);
  font-family: "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  text-rendering: geometricPrecision;
}

img{ max-width:100%; height:auto; }
.container{
  width: min(var(--container), calc(100% - (var(--gutter) * 2)));
  margin-inline:auto;
}

/* Links (thick underline like Mozilla) */
a{
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: var(--underline);
  text-underline-offset: 4px;
}
a:hover{ text-decoration-thickness: var(--underline-hover); }

/* Typography */
h1,h2,h3,h4,h5,h6{
  font-family: "Zilla Slab", ui-serif, Georgia, serif;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0.9em 0 0.4em;
  font-weight: 800;
}
h1{ font-size: clamp(36px, 4.2vw, 60px); }
h2{ font-size: clamp(28px, 3.3vw, 44px); }
h3{ font-size: clamp(22px, 2.4vw, 32px); }

p{ margin: 0 0 1em; }
.kicker{
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

/* Header */
.site-header{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner{
  display:grid;
  grid-template-columns: auto 1fr;
  align-items:center;
  gap: 18px;
  padding: 16px 0;
}

.brand{
  display:flex;
  align-items:baseline;
  gap: 14px;
  min-width: 220px;
}
.site-title{
  font-family: "Zilla Slab", ui-serif, Georgia, serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 22px;
  text-decoration:none;
  line-height: 1;
  white-space: nowrap;
}
.site-description{
  margin:0;
  font-size: 13px;
  color: var(--muted);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 12px;
  min-width: 0;
}

.menu-toggle{
  display:none;
  background: transparent;
  border: 2px solid var(--border);
  padding: 10px 12px;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  cursor:pointer;
  white-space: nowrap;
}

/* Menu forced to one line on desktop */
.primary-nav{
  min-width: 0;
}
.primary-nav ul{
  display:flex;
  list-style:none;
  margin:0;
  padding:0;
  gap: 10px;
  align-items:center;
  flex-wrap: nowrap;        /* key */
  white-space: nowrap;      /* key */
  overflow: hidden;         /* key */
  text-overflow: ellipsis;
}
.primary-nav li{ flex: 0 0 auto; }
.primary-nav a{
  text-decoration:none;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 12px;
  text-transform: uppercase;
  padding: 10px 10px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a{
  background: #f2f2f2;
}

/* Two-tone divider bar */
.section-divider{
  width:100%;
  height: var(--dsdmmpro-divider-height, 12px);
  background: var(--dsdmmpro-divider-color, #ff8a3d);
  position: relative;
}
.section-divider:before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height: var(--dsdmmpro-divider-topline-height, 2px);
  background: var(--dsdmmpro-divider-topline, rgba(0,0,0,0.18));
}

/* Hero */
.hero{ padding: 44px 0 18px; }
.hero .hero__inner{ max-width: 86ch; }
.hero .lead{
  font-size: 20px;
  color: #1a1a1a;
  margin-top: 14px;
}

/* Layout with left sidebar */
.layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 26px;
  align-items:start;
}
.sidebar{
  position: sticky;
  top: 92px; /* below sticky header */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sidebar .widget{
  margin: 0 0 18px;
}
.sidebar .widget:last-child{ margin-bottom:0; }
.sidebar .widget-title{
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  margin: 0 0 10px;
  color: #222;
}
.sidebar ul{ padding-left: 1.1em; margin: 0; }
.sidebar a{ text-decoration-thickness: 2px; }

/* Content */
.content{ padding: 22px 0 60px; }
.entry-meta{
  font-size: 14px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: 12px;
}
.entry-content{ max-width: 80ch; }
.entry-content blockquote{
  border-left: 4px solid #000;
  margin: 24px 0;
  padding: 8px 0 8px 16px;
  color: #111;
  font-style: italic;
}
.entry-content hr{ border:0; border-top: 1px solid var(--border); margin: 28px 0; }

/* Index cards */
.post-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.card{
  grid-column: span 12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h2{ margin-top:0; font-size: clamp(24px, 2.8vw, 34px); }

/* Front page: DO NOT underline article titles */
.home .card h2 a,
.front-page .card h2 a{
  text-decoration: none;
}
.home .card h2 a:hover,
.front-page .card h2 a:hover{
  text-decoration: underline;
  text-decoration-thickness: var(--underline-hover);
}

.card .excerpt{ color: #1a1a1a; margin: 10px 0 0; }
.card .more{
  margin-top: 14px;
  display:inline-block;
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* Footer */
.site-footer{
  border-top: 1px solid var(--border);
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}
.footer-nav ul{
  list-style:none;
  padding:0;
  margin: 0 0 14px;
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items:center;
}
.footer-nav a{
  text-decoration:none;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
}
.footer-nav a:hover{ background:#f2f2f2; }

/* Responsive */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ position: static; }
}
@media (max-width: 900px){
  .site-header__inner{ grid-template-columns: 1fr; }
  .nav-row{ justify-content: space-between; width:100%; }
  .menu-toggle{ display:inline-flex; }
  .primary-nav{ display:none; width: 100%; }
  .primary-nav.is-open{ display:block; }
  .primary-nav ul{
    flex-direction: column;
    align-items:flex-start;
    padding-top: 10px;
    overflow: visible;
    white-space: normal;
  }
}

/* WP core helpers */
.alignwide { max-width: 1200px; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.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; white-space: nowrap;
}

/* Subscribe button */
.subscribe-btn{
  background:#000;
  color:#fff;
  border:2px solid #000;
  padding:14px 20px;
  font-size:13px;
  letter-spacing:0.12em;
}
.subscribe-btn:hover{
  filter:brightness(0.9);
}
/* Modal: Subscribe (Substack embed) */
.no-scroll { overflow: hidden; }

.subscribe-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
.subscribe-modal.is-open{ display:block; }

.subscribe-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.55);
}

.subscribe-modal__panel{
  position: relative;
  width: min(760px, calc(100% - 32px));
  margin: 60px auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  padding: 18px;
}

.subscribe-modal__close{
  position:absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.15);
  background:#fff;
  font-weight: 900;
  cursor:pointer;
}

.subscribe-modal__body{
  padding-top: 20px;
}

.subscribe-modal__fallback h2{
  margin-top: 0;
}

/* Mobile hamburger icon */
.menu-toggle{
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hamburger{
  width: 22px;
  height: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span{
  display: block;
  height: 3px;
  width: 100%;
  background: #000;
  border-radius: 2px;
}

/* Hide sidebar completely on mobile */
@media (max-width: 980px){
  .sidebar{
    display: none;
  }
}

/* Show hamburger ONLY on mobile */
@media (min-width: 901px){
  .menu-toggle{
    display: none !important;
  }
}

/* Inline Substack subscribe embed (shown on every post) */
.post-subscribe{
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-width: 80ch;
}
.post-subscribe__title{
  margin: 0 0 6px;
  font-size: clamp(22px, 2.4vw, 28px);
}
.post-subscribe__text{
  margin: 0 0 14px;
  color: #1a1a1a;
}
.post-subscribe__iframe{
  width: 100%;
  height: 240px;
  border: 0;
  border-radius: 12px;
}

.post-subscribe__note{
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.post-subscribe__note a{
  text-decoration-thickness: 2px;
}

/* Subscribe modal polish */
.subscribe-modal__panel{
  max-height: calc(100vh - 80px);
  overflow: auto;
}
.subscribe-modal.is-open .subscribe-modal__panel{
  animation: dsdmmproPop 180ms ease-out;
}
@keyframes dsdmmproPop{
  from{ transform: translateY(8px); opacity: .85; }
  to{ transform: translateY(0); opacity: 1; }
}

/* Visual hard-block + preview (SEO-safe) */
.dsd-gate{
  position: relative;
}

/* Preview: show only the first chunk so readers see what they’re getting */
.dsd-gate__preview{
  max-height: 18rem;
  overflow: hidden;
  position: relative;
}

/* Fade out at bottom of preview */
.dsd-gate__preview:after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 7rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
  pointer-events:none;
}

body.dsd-gate-active .dsd-gate__preview{
  filter: blur(1.6px);
}

/* Overlay */
.dsd-gate__overlay{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(6px);
  border-radius: 12px;
}

.dsd-gate__card{
  width: min(560px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dsd-gate__title{
  margin: 0 0 8px;
  font-size: clamp(22px, 2.6vw, 30px);
}

.dsd-gate__text{
  margin: 0 0 14px;
  color: #1a1a1a;
}

.dsd-gate__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid #000;
  background:#000;
  color:#fff;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  cursor:pointer;
  text-decoration:none;
  line-height:1;
  white-space: nowrap;
}
.dsd-gate__btn:hover{ filter: brightness(.93); }

.dsd-gate__fineprint{
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

/* Subscribe modal actions */
.subscribe-modal__actions{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  flex-wrap: wrap;
  margin-top: 14px;
}

.subscribe-modal__action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid #000;
  background:#000;
  color:#fff;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  cursor:pointer;
  white-space: nowrap;
}
.subscribe-modal__action:hover{ filter: brightness(.93); }

.subscribe-modal__action--ghost{
  background: transparent;
  color:#000;
}

.subscribe-modal__fineprint{
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

/* Gate visibility control (fix: prevent unlock loop) */
.dsd-gate__overlay[aria-hidden="true"]{
  display: none;
}
body.dsd-gate-active .dsd-gate__overlay[aria-hidden="false"]{
  display: grid;
}
/* When unlocked, show full article (remove preview clamp) */
body:not(.dsd-gate-active) .dsd-gate__preview{
  max-height: none;
  overflow: visible;
}
body:not(.dsd-gate-active) .dsd-gate__preview:after{
  display: none;
}

/* Popup-only mode (no gate): ensure full content is visible */
.dsd-gate__overlay{
  display: none !important;
}
.dsd-gate__preview{
  max-height: none !important;
  overflow: visible !important;
  filter: none !important;
}
.dsd-gate__preview:after{
  display: none !important;
}

/* Mobile overflow fixes (prevent content wider than screen) */
html, body{
  width: 100%;
  overflow-x: hidden;
}
*, *::before, *::after{
  box-sizing: border-box;
}
img, video, iframe, embed, object{
  max-width: 100%;
}
.entry-content, .layout, .site-header__inner, .nav-row{
  min-width: 0;
}
.entry-content *{
  overflow-wrap: anywhere;
  word-break: break-word;
}
.entry-content pre,
.entry-content code{
  max-width: 100%;
}
.entry-content pre{
  overflow-x: auto;
}
.entry-content table{
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Social share buttons */
.share-buttons{
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.share-btn{
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #ddd;
  color: #111;
}
.share-btn:hover{
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Social share icon buttons */
.share-buttons{
  display:flex;
  gap:10px;
  margin-top:10px;
}
.share-btn{
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid #ddd;
  color:#111;
}
.share-btn svg{
  width:16px;
  height:16px;
  fill: currentColor;
}
.share-btn:hover{
  background:#000;
  color:#fff;
  border-color:#000;
}
