/*
Theme Name: LyfGem Journal
Author: LyfGem
Description: Editorial WordPress theme for the LyfGem Journal, styled to match lyfgem.com.
Version: 1.1.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: lyfgem-journal
*/

/* ============================================================
   DESIGN TOKENS - sampled directly from lyfgem.com
   ============================================================ */
:root {
  /* Brand */
  --blue:        #117ACA;   /* primary buttons, links, accents */
  --blue-hover:  #0E63A4;
  --blue-press:  #0B4F84;
  --blue-tint:   #EAF4FC;   /* soft blue fill */
  --blue-glow:   #EAF7FF;   /* hero background wash */

  /* Neutrals */
  --ink:         #071123;   /* headings, near-black navy */
  --ink-soft:    #0D1E3B;
  --muted:       #5D646F;   /* body copy, secondary text */
  --line:        #E0E5EB;   /* borders */
  --surface:     #EEF2F7;   /* icon tiles, subtle fills */
  --tint:        #F5F8FC;   /* section backgrounds */
  --white:       #FFFFFF;

  /* Status accents */
  --ok-bg:       #E6F8F0;
  --ok-ink:      #0B6B47;
  --warn-bg:     #FEF3E4;
  --warn-ink:    #8A5A17;

  /* Type - matches the site's system stacks (no webfont dependency) */
  --font-sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;

  /* Shape */
  --r-sm:   8px;
  --r:      12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(7, 17, 35, .05);
  --shadow:    0 1px 3px rgba(7, 17, 35, .06), 0 8px 24px rgba(7, 17, 35, .05);
  --shadow-lg: 0 2px 6px rgba(7, 17, 35, .06), 0 18px 48px rgba(7, 17, 35, .08);

  --container: 1180px;
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
button, input { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.12;
}

.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 12px; left: 12px; z-index: 9999; width: auto; height: auto;
  padding: 10px 16px; background: var(--blue); color: #fff;
  border-radius: var(--r-pill); clip: auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 24px;
  background: var(--blue); color: #fff;
  border: 1px solid var(--blue); border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn:active { background: var(--blue-press); transform: translateY(1px); }

.btn-light { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-light:hover { background: var(--tint); color: var(--ink); border-color: var(--line); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 30px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 34px; height: 34px; flex: none; color: var(--blue); }
.brand-main {
  font-family: var(--font-serif); font-weight: 700; font-size: 30px; line-height: 1;
  color: var(--ink); letter-spacing: -.5px;
}
.brand-journal {
  align-self: center; font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-tint); border-radius: var(--r-pill); padding: 4px 9px;
}
.brand .custom-logo { max-height: 44px; width: auto; }

.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; display: flex; gap: 30px; padding: 0; margin: 0; }
.primary-nav a { font-size: 15px; font-weight: 500; color: var(--muted); }
.primary-nav a:hover { color: var(--ink); }
.primary-nav .current-menu-item > a { color: var(--ink); }

.header-actions { display: flex; gap: 10px; align-items: center; }
.search-link {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--muted); font-size: 17px; background: var(--white);
}
.search-link:hover { border-color: var(--blue); color: var(--blue); }

.menu-toggle {
  display: none; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--white); padding: 9px 13px; color: var(--ink); cursor: pointer;
}

.mobile-panel { display: none; }
.mobile-panel.open {
  display: block; border-top: 1px solid var(--line);
  background: var(--white); padding: 18px 0 24px;
}
.mobile-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mobile-panel a {
  display: block; padding: 11px 12px; border-radius: var(--r-sm);
  font-weight: 500; color: var(--ink);
}
.mobile-panel a:hover { background: var(--tint); }

/* ============================================================
   SHARED PIECES
   ============================================================ */
.eyebrow {
  display: inline-block; color: var(--blue);
  font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
}
.section-head {
  display: flex; justify-content: space-between; gap: 24px;
  align-items: flex-end; margin-bottom: 30px;
}
.section-title { margin: 8px 0 0; font-size: clamp(30px, 3.6vw, 42px); }

.meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  color: var(--muted); font-size: 13px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 80px 0 64px;
  background:
    radial-gradient(900px 520px at 50% -140px, var(--blue-glow) 0%, rgba(234, 247, 255, 0) 70%),
    var(--white);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; }

.hero-copy h1 {
  margin: 16px 0 26px;
  font-size: clamp(40px, 5.2vw, 62px);
  letter-spacing: -.02em; line-height: 1.06;
}
.hero-copy h1 em { display: block; font-style: italic; font-weight: 700; color: var(--muted); }
.hero-copy p { max-width: 600px; margin: 0 0 30px; font-size: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 20px; font-size: 14px; color: var(--muted); }

.hero-art {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 26px;
}
.hero-art-inner {
  background: var(--tint); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px;
}
.hero-art-inner strong {
  display: block; font-family: var(--font-serif); font-size: 25px; line-height: 1.2;
  color: var(--ink); margin: 10px 0 12px;
}
.hero-art-inner p { margin: 0; font-size: 15px; }

/* ============================================================
   FEATURED ARTICLE
   ============================================================ */
.featured { padding: 20px 0 76px; }
.featured-card {
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow);
}
.featured-media { min-height: 400px; background: var(--surface); }
.featured-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-copy { padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.featured-copy h2 { margin: 14px 0 16px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; }
.featured-copy p { margin: 0 0 18px; }
.featured-copy .btn { align-self: flex-start; margin-top: 20px; }

/* ============================================================
   TOPIC CARDS
   ============================================================ */
.topic-strip { padding: 0 0 76px; }
.topic-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.topic {
  display: block; padding: 26px 22px; min-height: 156px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.topic:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #CBD8E6; }
.topic:before {
  content: ""; display: block; width: 38px; height: 38px; margin-bottom: 16px;
  background: var(--blue-tint); border-radius: var(--r-sm);
}
.topic:nth-child(2):before { background: var(--surface); }
.topic:nth-child(3):before { background: var(--ok-bg); }
.topic:nth-child(4):before { background: var(--warn-bg); }
.topic:nth-child(5):before { background: var(--blue-tint); }
.topic strong {
  display: block; font-family: var(--font-serif); font-size: 21px; line-height: 1.2;
  color: var(--ink); margin-bottom: 9px;
}
.topic span { color: var(--muted); font-size: 14px; }

/* ============================================================
   POST CARDS
   ============================================================ */
.latest, .archive { padding: 8px 0 84px; }
.post-grid, .archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #CBD8E6; }
.card-media { display: block; aspect-ratio: 16 / 10; background: var(--surface); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 24px; }
.card-cat {
  display: inline-block; color: var(--blue); background: var(--blue-tint);
  border-radius: var(--r-pill); padding: 4px 11px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.card h3 { margin: 13px 0 10px; font-size: 22px; line-height: 1.22; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--blue); }
.card-excerpt { margin: 0 0 16px; font-size: 15px; }
.read-more { font-size: 14px; font-weight: 600; color: var(--blue); }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter {
  padding: 76px 0;
  background: linear-gradient(180deg, var(--tint) 0%, var(--white) 100%);
  border-top: 1px solid var(--line);
}
.newsletter-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.newsletter h2 { margin: 12px 0 14px; font-size: clamp(30px, 3.6vw, 42px); }
.newsletter p { margin: 0; }

.subscribe-form { display: flex; gap: 10px; }
.subscribe-form input {
  flex: 1; min-height: 48px; padding: 0 18px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink);
}
.subscribe-form input::placeholder { color: #8A929C; }
.subscribe-form input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 122, 202, .15);
}
.subscribe-note { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ============================================================
   PAGE HERO / ARCHIVES
   ============================================================ */
.page-hero {
  padding: 66px 0 46px; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(800px 400px at 50% -160px, var(--blue-glow) 0%, rgba(234, 247, 255, 0) 70%),
    var(--white);
}
.page-hero h1 { margin: 12px 0 14px; font-size: clamp(36px, 5vw, 54px); }
.page-hero p { max-width: 700px; margin: 0 0 20px; font-size: 18px; }

.pagination { margin-top: 44px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; padding: 10px 15px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--white); color: var(--muted); font-size: 14px; font-weight: 500;
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-wrap { padding: 60px 0 84px; }
.single-header { max-width: 820px; margin: 0 auto 34px; }
.single-header h1 { margin: 14px 0 18px; font-size: clamp(36px, 5vw, 56px); }
.single-deck { font-size: 20px; color: var(--muted); max-width: 720px; margin: 0 0 20px; }

.single-featured {
  max-width: 1020px; margin: 0 auto 44px;
  background: var(--surface); border-radius: var(--r-xl); overflow: hidden;
}
.single-featured img { width: 100%; max-height: 600px; object-fit: cover; }

.entry-content { max-width: 720px; margin: 0 auto; font-size: 18px; color: #3F4753; }
.entry-content p { margin: 0 0 1.35em; }
.entry-content h2, .entry-content h3 { margin-top: 1.9em; margin-bottom: .55em; }
.entry-content h2 { font-size: 32px; }
.entry-content h3 { font-size: 25px; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.25em; }
.entry-content li { margin: .45em 0; }
.entry-content blockquote {
  margin: 32px 0; padding: 24px 28px;
  background: var(--tint); border: 1px solid var(--line);
  border-left: 3px solid var(--blue); border-radius: var(--r);
  font-family: var(--font-serif); font-style: italic; font-size: 21px; line-height: 1.4;
  color: var(--ink);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content img { margin: 30px auto; border-radius: var(--r); }
.entry-content code { background: var(--surface); border-radius: 5px; padding: 2px 6px; font-size: .9em; }
.entry-content pre {
  background: var(--ink); color: #E6EDF5; padding: 20px 22px;
  border-radius: var(--r); overflow-x: auto;
}
.entry-content pre code { background: none; color: inherit; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--tint); color: var(--ink); }

.article-end { max-width: 720px; margin: 50px auto 0; padding-top: 26px; border-top: 1px solid var(--line); }
.share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-row strong { color: var(--ink); font-size: 14px; margin-right: 4px; }
.share-row a {
  padding: 8px 15px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--white); color: var(--muted); font-size: 13px; font-weight: 500;
}
.share-row a:hover { border-color: var(--blue); color: var(--blue); }

.related { max-width: 1020px; margin: 76px auto 0; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-form { display: flex; gap: 10px; max-width: 620px; }
.search-form input {
  flex: 1; min-height: 48px; padding: 0 18px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink);
}
.search-form input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 122, 202, .15);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--tint); border-top: 1px solid var(--line);
  color: var(--muted); padding: 64px 0 26px;
}
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr .8fr 1.1fr; gap: 44px; }
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif); font-weight: 700; font-size: 27px; color: var(--ink);
}
.footer-brand svg { width: 30px; height: 30px; color: var(--blue); flex: none; }
.footer-tagline { max-width: 330px; font-size: 15px; margin: 14px 0 0; }

.site-footer h3 {
  margin: 0 0 14px; font-family: var(--font-sans);
  font-size: 12px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--ink);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 9px 0; }
.site-footer a { color: var(--muted); font-size: 15px; }
.site-footer a:hover { color: var(--blue); }

.footer-bottom {
  border-top: 1px solid var(--line); margin-top: 44px; padding-top: 20px;
  display: flex; justify-content: space-between; gap: 20px; font-size: 13px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1020px) {
  .primary-nav { display: none; }
  .menu-toggle { display: block; }
  .header-actions { margin-left: auto; }
  .hero-grid, .featured-card, .newsletter-inner { grid-template-columns: 1fr; }
  .featured-media { min-height: 300px; }
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
  .post-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 32px), var(--container)); }
  .header-inner { min-height: 66px; gap: 12px; }
  .brand-main { font-size: 25px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-journal { display: none; }
  .header-actions .btn { display: none; }
  .hero { padding: 48px 0 40px; }
  .hero-grid { gap: 34px; }
  .hero-art { padding: 18px; }
  .featured-copy { padding: 30px 24px; }
  .topic-grid, .post-grid, .archive-grid { grid-template-columns: 1fr; }
  .newsletter { padding: 56px 0; }
  .newsletter-inner { gap: 30px; }
  .subscribe-form { flex-direction: column; }
  .subscribe-form .btn { width: 100%; }
  .single-wrap { padding: 40px 0 60px; }
  .entry-content { font-size: 17px; }
  .entry-content h2 { font-size: 27px; }
  .entry-content h3 { font-size: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
