/*
Theme Name: Cowry Tech News
Theme URI: https://cowrytechnews.com
Author: Cowry Tech News
Description: Editorial theme for Cowry Tech News — gold/paper/Fraunces system from locked mockups. Logo-only differentiation from Lone Cowry firm.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: cowry-tech-news
*/

:root {
  --gold: #C9A227;
  --gold-bright: #E6B980;
  --gold-deep: #8C5A12;
  --ink: #0B0F14;
  --ink-2: #141A22;
  --surface: #F7F5F0;
  --surface-2: #FFFFFF;
  --text: #0B0F14;
  --text-secondary: #4A5564;
  --text-muted: #6B7280;
  --border: rgba(11, 15, 20, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-deep); }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

.wrap { width: min(100% - 2rem, var(--container)); margin-inline: auto; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* —— Nav —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.site-branding {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.site-branding .mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.site-branding .mark img,
.site-branding .mark svg { width: 100%; height: 100%; }
.wordmark-text { display: flex; flex-direction: column; gap: 0.1rem; }
.wordmark-text strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.wordmark-text span {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.wordmark-img {
  height: 40px;
  width: auto;
  max-width: 220px;
}
.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
  padding: 0;
}
.primary-nav a { color: var(--text-secondary); }
.primary-nav a:hover,
.primary-nav .current-menu-item > a { color: var(--ink); }
.nav-search {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
}
.nav-search input {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  width: 5.5rem;
  outline: none;
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-secondary);
}
@media (max-width: 840px) {
  .nav-toggle { display: block; }
  .primary-nav { display: none; width: 100%; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0.75rem; padding: 0.75rem 0 1rem; }
  .nav-inner { flex-wrap: wrap; }
  .nav-search { display: none; }
}

/* —— Lead —— */
.lead {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.75rem;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 840px) { .lead { grid-template-columns: 1fr; } }
.lead-media {
  background: linear-gradient(145deg, var(--ink-2), #243044);
  border-radius: var(--radius);
  min-height: 280px;
  overflow: hidden;
  position: relative;
}
.lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}
.lead-media .placeholder-label {
  position: absolute;
  inset: auto 1.25rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #F5F2EB;
  opacity: 0.7;
}
.lead-copy .eyebrow { margin-bottom: 0.65rem; }
.lead-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.lead-copy .dek {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  max-width: 38rem;
}

/* —— Morning Brief —— */
.brief {
  margin: 1.75rem 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.35rem;
}
.brief-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.brief-head h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.brief-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  counter-reset: brief;
}
.brief-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.55rem;
  font-size: 0.95rem;
  line-height: 1.45;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.brief-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.brief-list li::before {
  counter-increment: brief;
  content: counter(brief);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-deep);
  padding-top: 0.2rem;
}
.brief-empty {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* —— Sections / rails —— */
.section { margin: 2rem 0 0.5rem; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--ink);
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.section-head a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
@media (max-width: 840px) { .rail { grid-template-columns: 1fr; } }

.story-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.05rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 9.5rem;
}
.story-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.25;
}
.story-card .dek {
  color: var(--text-secondary);
  font-size: 0.88rem;
  flex: 1;
  margin: 0;
}

.latest {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1.5rem;
  margin: 0.5rem 0 2.5rem;
}
@media (max-width: 700px) { .latest { grid-template-columns: 1fr; } }
.latest-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.latest-item h3 {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
  font-family: var(--font-sans);
}

/* —— Article —— */
.article-wrap {
  width: min(100% - 2rem, 42rem);
  margin: 2rem auto 3rem;
}
.article-wrap .eyebrow { margin-bottom: 0.75rem; }
.article-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}
.article-wrap .dek {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}
.article-wrap .meta {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.entry-content { font-size: 1.02rem; line-height: 1.65; }
.entry-content p { margin: 0 0 1.1rem; }
.entry-content h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 1.75rem 0 0.7rem;
}
.entry-content h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 1.4rem 0 0.55rem;
}
.entry-content ul, .entry-content ol {
  margin: 0 0 1.1rem 1.25rem;
}
.entry-content a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.related {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}
.related h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}
.related a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.related a:hover { color: var(--gold-deep); }

/* —— Page —— */
.page-wrap {
  width: min(100% - 2rem, 42rem);
  margin: 2rem auto 3rem;
}
.page-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.page-wrap .entry-content h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 1.75rem 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}
.site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 600;
}
.site-footer .footer-links {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
}
.site-footer .footer-links a { color: var(--text-secondary); }
.site-footer .owner {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* —— Archive / index —— */
.archive-head {
  padding: 1.75rem 0 1rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 1.25rem;
}
.archive-head h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
}
.posts-list { margin-bottom: 2.5rem; }
.posts-list .latest-item { padding: 1rem 0; }

.pagination {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1.5rem 0 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pagination a, .pagination span {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.pagination .current { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}


/* —— Cookie consent —— */
.ctn-consent-banner {
  position: fixed;
  z-index: 1000;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  width: min(calc(100% - 2rem), 760px);
  margin-inline: auto;
  padding: 1rem 1.15rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 36px rgba(11, 15, 20, 0.2);
  font-family: var(--font-sans);
}
.ctn-consent-banner[hidden] { display: none; }
.ctn-consent-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.ctn-consent-copy { flex: 1 1 auto; }
.ctn-consent-title {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}
.ctn-consent-text {
  max-width: 42rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}
.ctn-consent-text a {
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ctn-consent-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ctn-consent-button {
  min-width: 5.5rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font: 600 0.78rem/1 var(--font-sans);
  cursor: pointer;
}
.ctn-consent-accept {
  color: var(--ink);
  background: var(--gold);
}
.ctn-consent-reject {
  color: var(--ink);
  background: transparent;
}
.ctn-consent-button:hover { filter: brightness(0.96); }
.ctn-consent-button:focus-visible,
.ctn-cookie-preferences:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}
.ctn-cookie-preferences {
  margin: 0.75rem 0 0;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ctn-cookie-preferences:hover { color: var(--gold-deep); }
@media (max-width: 640px) {
  .ctn-consent-banner { bottom: 0.75rem; }
  .ctn-consent-inner { align-items: stretch; flex-direction: column; }
  .ctn-consent-actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .ctn-consent-banner { scroll-behavior: auto; }
}
