/*
Theme Name: Meridian
Theme URI: https://example.com/meridian
Author: Generated for Jackson
Author URI: https://example.com
Description: A clean, editorial blog theme. Hero banner, stacked post cards with excerpts, a Topics/Archives sidebar, and a multi-column footer. All colours and fonts live in the design tokens block below for easy re-skinning.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: meridian
Tags: blog, editorial, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, right-sidebar
*/

/* ============================================================
   DESIGN TOKENS  —  change fonts & colours here, nowhere else
   ============================================================ */
:root {
  /* Brand / colour */
  --color-ink:            #20409a;  /* primary text + brand         */
  --color-secondary:      #2a3140;  /* secondary text               */
  --color-bg:             #ffffff;  /* page background              */
  --color-surface:        #e8ecee;  /* cards, hovers, footer band   */
  --color-muted:          #066699;  /* meta text, captions          */
  --color-border:         #e6e8ec;  /* hairlines, dividers          */
  --color-accent:         #066699;  /* links, buttons, eyebrow rule */
  --color-accent-strong:  #000000;  /* accent hover / active        */
  --color-accent-contrast:#ffffff;  /* text on accent               */

  /* Type — swap the font names here, then update the Google Fonts
     line in functions.php (enqueue) to match. */
  --font-heading: 'Raleway', system-ui, -apple-system, sans-serif;
  --font-body:    'Raleway', system-ui, -apple-system, sans-serif;
  --font-meta:    system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Scale & rhythm */
  --maxw: 1180px;          /* outer content width            */
  --maxw-text: 720px;      /* readable measure for article   */
  --gap: 2.5rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26,31,46,.06), 0 8px 24px rgba(26,31,46,.06);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-strong); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.15;
  color: var(--color-ink);
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.25em; }

/* Focus visibility (accessibility floor) */
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--color-ink); color: #fff; padding: .75rem 1rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky; top: 0; z-index: 100;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: 1rem;
}
.site-branding { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.custom-logo { max-height: 52px; width: auto; }
.site-title {
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600;
  margin: 0; letter-spacing: -0.02em;
}
.site-title a { color: var(--color-ink); text-decoration: none; }
.site-description { margin: 0; font-family: var(--font-meta); font-size: .85rem; color: var(--color-muted); }

/* Primary nav */
.main-nav ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.main-nav a {
  font-family: var(--font-meta); font-size: .95rem; font-weight: 500;
  color: var(--color-ink); text-decoration: none; padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--color-accent); border-bottom-color: var(--color-accent); }

/* Mobile nav toggle */
.nav-toggle {
  display: none; background: none; border: 1px solid var(--color-border);
  border-radius: 8px; padding: .5rem .75rem; cursor: pointer;
  font-family: var(--font-meta); font-size: .9rem; color: var(--color-ink);
}

/* ============================================================
   HERO
   ============================================================ */
.page-hero {
  position: relative; background: var(--color-ink); color: #fff; overflow: hidden;
}
.page-hero__media { position: absolute; inset: 0; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.page-hero__inner {
  position: relative; padding-block: clamp(3rem, 8vw, 6rem);
}
.page-hero__eyebrow {
  font-family: var(--font-meta); text-transform: uppercase; letter-spacing: .12em;
  font-size: .75rem; color: var(--color-accent-contrast); opacity: .85; margin: 0 0 .75rem;
}
.page-hero h1 { color: #fff; margin: 0; }
.page-hero__lead { margin: 1rem 0 0; max-width: 46ch; opacity: .92; }

/* ============================================================
   LAYOUT: content + sidebar
   ============================================================ */
.site-main { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.content-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap);
  align-items: start;
}
.content-grid--full { grid-template-columns: minmax(0, 1fr); }

/* ============================================================
   POST CARDS (listing)
   ============================================================ */
.post-list { display: flex; flex-direction: column; gap: 2.5rem; }

.post-card {
  display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 1.75rem;
  align-items: start; padding-bottom: 2.5rem; border-bottom: 1px solid var(--color-border);
}
.post-card:last-child { border-bottom: 0; }
.post-card__thumb { border-radius: var(--radius); overflow: hidden; background: var(--color-surface); }
.post-card__thumb img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; transition: transform .4s ease; }
.post-card__thumb:hover img { transform: scale(1.03); }

.post-card__eyebrow {
  font-family: var(--font-meta); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--color-accent); font-weight: 600;
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .6rem;
}
.post-card__eyebrow::before { content: ""; width: 1.75rem; height: 2px; background: var(--color-accent); }
.post-card__title { margin: 0 0 .4rem; font-size: 1.5rem; }
.post-card__title a { color: var(--color-ink); }
.post-card__title a:hover { color: var(--color-accent); text-decoration: none; }
.post-meta { font-family: var(--font-meta); font-size: .85rem; color: var(--color-muted); margin: 0 0 .75rem; }
.post-card__excerpt { margin: 0 0 1rem; color: #2a3140; }

.read-more {
  font-family: var(--font-meta); font-weight: 600; font-size: .95rem;
  display: inline-flex; align-items: center; gap: .4rem;
}
.read-more::after { content: "\2192"; transition: transform .2s ease; }
.read-more:hover { text-decoration: none; }
.read-more:hover::after { transform: translateX(3px); }

/* ============================================================
   SINGLE / PAGE
   ============================================================ */
.entry { max-width: var(--maxw-text); }
.entry__header { margin-bottom: 2rem; }
.entry__header h1 { margin-bottom: .6rem; }
.entry__featured { border-radius: var(--radius); overflow: hidden; margin: 0 0 2rem; }
.entry__content { font-size: 1.15rem; }
.entry__content .wp-block-paragraph { color: var(--color-secondary); }
.entry__content h2 { margin-top: 2rem; }
.entry__content h3 { margin-top: 1.75rem; }
.entry__content img { border-radius: var(--radius); margin-block: 1.5rem; }
.entry__content blockquote {
  margin: 1.75rem 0; padding: .5rem 0 .5rem 1.5rem;
  border-left: 3px solid var(--color-accent); color: #33394a; font-style: italic;
}
.entry__content pre {
  background: var(--color-ink); color: #f4f5f7; padding: 1.25rem; border-radius: var(--radius);
  overflow-x: auto; font-size: .95rem; line-height: 1.5;
}
.entry__content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.entry__content :not(pre) > code { background: var(--color-surface); padding: .1em .35em; border-radius: 4px; }
.entry__footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.tag-list a {
  display: inline-block; font-family: var(--font-meta); font-size: .8rem;
  background: var(--color-surface); padding: .3rem .7rem; border-radius: 999px; margin: 0 .35rem .35rem 0;
  color: var(--color-muted);
}
.tag-list a:hover { background: var(--color-accent); color: #fff; text-decoration: none; }

/* Post navigation */
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.post-nav a { font-family: var(--font-meta); font-weight: 500; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block; font-family: var(--font-meta); font-weight: 600; font-size: .95rem;
  background: var(--color-accent); color: var(--color-accent-contrast);
  padding: .7rem 1.4rem; border-radius: 8px; border: 0; cursor: pointer;
}
.btn:hover { background: var(--color-accent-strong); color: #fff; text-decoration: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar .widget { margin-bottom: 2.25rem; }
.widget-title {
  font-family: var(--font-heading); font-size: 1.05rem; text-transform: uppercase;
  letter-spacing: .06em; margin: 0 0 1rem; padding-bottom: .6rem;
  border-bottom: 2px solid var(--color-ink);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: .4rem 0; border-bottom: 1px solid var(--color-border); font-family: var(--font-meta); font-size: .95rem; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--color-ink); }
.sidebar a:hover { color: var(--color-accent); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { margin-top: 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers {
  font-family: var(--font-meta); font-size: .95rem; min-width: 2.5rem; text-align: center;
  padding: .5rem .75rem; border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-ink);
}
.pagination a.page-numbers:hover { border-color: var(--color-accent); color: var(--color-accent); text-decoration: none; }
.pagination .page-numbers.current { background: var(--color-ink); color: #fff; border-color: var(--color-ink); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--color-ink); color: #cdd2db; margin-top: 4rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--color-accent-contrast); opacity: .85; }
.footer-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem;
  padding-block: 3rem;
}
.footer-col h3 {
  color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem;
  font-family: var(--font-meta);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .5rem; font-family: var(--font-meta); font-size: .95rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.5rem;
  font-family: var(--font-meta); font-size: .85rem; color: #9aa2b1;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area { max-width: var(--maxw-text); margin-top: 3rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { padding: 1.25rem 0; border-bottom: 1px solid var(--color-border); }
.comment-content { color: var(--color-secondary); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--color-border);
  border-radius: 8px; font-family: var(--font-meta); font-size: 1rem; margin-bottom: 1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card__thumb { max-width: 100%; }
}
@media (max-width: 720px) {
  body { font-size: 1.05rem; }
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 1rem 1.25rem;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
