/*
 Theme Name:   Mount Olive Chronicle
 Theme URI:    https://mountolivechronicle.com
 Description:  Framework theme for Mount Olive Chronicle. Zero hardcoded layout constraints — all widths, spacing, colors, and layout controlled via Appearance → Customize → Chronicle Settings.
 Author:       Mount Olive Chronicle
 Template:     generatepress
 Version:      3.0.0
 Text Domain:  moc
*/

/*
  ARCHITECTURE NOTES FOR DEVELOPERS
  ──────────────────────────────────
  This theme works WITH GeneratePress, not against it.

  GeneratePress controls:
  · Outer container width       → Customize → Layout → Container
  · Body font size              → Customize → Typography
  · Default link colors         → Customize → Colors

  This theme controls:
  · CSS custom properties (colors, fonts) output via wp_head
  · Article typography (.moc-content)
  · Sidebar layout (.moc-two-col)
  · Component styles (cards, bylines, author box, etc.)
  · Hiding default GP header/footer (we use Elements instead)

  NOTHING in this file uses hardcoded px widths for layout.
  All widths come from CSS variables set by the Customizer.
  To change the container width: Customize → Layout → Container Width
  To change the sidebar width:   Customize → Chronicle Settings → Layout → Sidebar Width
  To change content padding:     Customize → Chronicle Settings → Layout → Content Padding
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   All values injected dynamically via wp_head from Customizer.
   These are just fallback defaults if wp_head hasn't fired.
   ============================================================ */
:root {
  /* Colors — all controlled via Customizer → Chronicle Settings → Colors */
  --moc-accent:    #1a3a6e;
  --moc-red:       #b8282a;
  --moc-gold:      #c9973a;
  --moc-ink:       #1a1a1a;
  --moc-body:      #444444;
  --moc-muted:     #777777;
  --moc-rule:      #e0e0e0;
  --moc-bg:        #ffffff;
  --moc-bg-light:  #f7f5f0;

  /* Typography — controlled via Customizer → Chronicle Settings → Typography */
  --moc-serif:     'Playfair Display', Georgia, 'Times New Roman', serif;
  --moc-body-font: 'Source Serif 4', Georgia, serif;
  --moc-ui:        'Inter', system-ui, -apple-system, sans-serif;

  /* Layout — controlled via Customizer → Chronicle Settings → Layout */
  /* These are used for inner components only.
     The outer container is controlled by GeneratePress natively. */
  --moc-sidebar-w:      300px;   /* sidebar column width */
  --moc-col-gap:        48px;    /* gap between main and sidebar */
  --moc-content-pad-v:  40px;    /* vertical padding on page content */
  --moc-section-gap:    36px;    /* gap between homepage sections */
}

/* ============================================================
   BASE — minimal, only what GP doesn't already provide
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; display: block; }

/* ============================================================
   HIDE DEFAULT GP HEADER/FOOTER
   We use GeneratePress Elements for header and footer.
   GP Premium → Elements is required for this to work.
   If you're on free GP, add your header/footer content to
   header.php and footer.php directly instead.
   ============================================================ */
.site-header,
#masthead,
.site-footer,
#colophon,
.navigation-branding,
.site-branding { display: none !important; }

/* ============================================================
   GENERATEPRESS INTEGRATION
   We let GP's .container fully control outer width and padding.
   Customize → Layout → Container Width is the single source of truth.
   We only override the default article padding so our own
   .moc-two-col and .moc-full-content can handle inner spacing.
   ============================================================ */

/* Remove GP's default article top/bottom padding —
   our templates add their own via --moc-content-pad-v */
.page-template-default .inside-article,
.single .inside-article,
.archive .inside-article,
.search .inside-article,
.error404 .inside-article {
  padding-top: 0;
  padding-bottom: 0;
  /* DO NOT set max-width or horizontal padding here —
     GP's .container handles that via Customizer */
}

/* Full-bleed blocks (hero banners inside custom HTML pages)
   need to break out of GP's horizontal padding.
   Add class="moc-bleed" to any block that should be full width. */
.moc-bleed {
  margin-left: calc(-1 * var(--moc-bleed-offset, 24px));
  margin-right: calc(-1 * var(--moc-bleed-offset, 24px));
}

/* ============================================================
   LAYOUT — two column grid (article + sidebar)
   Width values come from CSS variables → Customizer
   ============================================================ */
.moc-two-col {
  display: grid;
  grid-template-columns: 1fr var(--moc-sidebar-w);
  gap: var(--moc-col-gap);
  align-items: start;
  padding: var(--moc-content-pad-v) 0;
}
@media (max-width: 900px) {
  .moc-two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Full width content (no sidebar) — used by page.php */
.moc-full-content {
  padding: var(--moc-content-pad-v) 0;
}


/* ============================================================
   PAGE BANNER — rendered by page.php for all static pages.
   Background color: Customize → Chronicle Settings → Colors → Page Header Background
   The banner sits OUTSIDE GP's .container so it's always full width.
   ============================================================ */
.moc-page-banner {
  /* Full bleed — breaks out of any container */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 48px 24px 40px;
  text-align: center;
  box-sizing: border-box;
}
.moc-page-banner-inner {
  max-width: 720px;
  margin: 0 auto;
}
.moc-page-banner-eyebrow {
  font-family: var(--moc-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--moc-gold);
  display: block;
  margin-bottom: 12px;
}
.moc-page-banner-title {
  font-family: var(--moc-serif);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.1;
}

/* Page content area — GP's container handles width */
.moc-page-content {
  padding: var(--moc-content-pad-v) 0;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.moc-label {
  font-family: var(--moc-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--moc-muted);
  display: block;
}
.moc-label--red    { color: var(--moc-red); }
.moc-label--gold   { color: var(--moc-gold); }
.moc-label--accent { color: var(--moc-accent); }

.moc-section-head {
  font-family: var(--moc-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--moc-muted);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--moc-ink);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.moc-section-head a {
  font-size: 11px;
  color: var(--moc-accent);
  letter-spacing: 1px;
  text-decoration: none;
}

.moc-cat {
  font-family: var(--moc-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--moc-red);
  text-decoration: none;
  display: inline-block;
}
.moc-cat:hover { color: var(--moc-accent); }

.moc-byline {
  font-family: var(--moc-ui);
  font-size: 12px;
  color: var(--moc-muted);
}
.moc-byline strong { color: var(--moc-ink); }
.moc-byline a { color: var(--moc-muted); text-decoration: none; }
.moc-byline a:hover { color: var(--moc-accent); }

.moc-credit {
  font-family: var(--moc-ui);
  font-size: 11px;
  color: #aaa;
  font-style: italic;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 24px;
}

/* ============================================================
   HOMEPAGE COMPONENTS
   ============================================================ */

/* Lead story */
.moc-lead { margin-bottom: var(--moc-section-gap); padding-bottom: var(--moc-section-gap); border-bottom: 1px solid var(--moc-rule); }
.moc-lead__img { overflow: hidden; margin-bottom: 8px; }
.moc-lead__img img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; transition: opacity 0.2s; }
.moc-lead__img a:hover img { opacity: 0.9; }
.moc-lead__title { font-family: var(--moc-serif); font-size: clamp(24px, 4vw, 36px); font-weight: 700; color: var(--moc-ink); line-height: 1.15; margin: 10px 0 12px; }
.moc-lead__title a { color: var(--moc-ink); text-decoration: none; }
.moc-lead__title a:hover { color: var(--moc-accent); }
.moc-lead__deck { font-family: var(--moc-body-font); font-size: 17px; font-weight: 300; line-height: 1.75; color: var(--moc-body); margin: 0; }

/* Article card (thumbnail + text) */
.moc-card { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--moc-rule); align-items: start; }
.moc-card:last-child { border-bottom: none; }
@media (max-width: 500px) { .moc-card { grid-template-columns: 1fr; } }
.moc-card__thumb { display: block; overflow: hidden; }
.moc-card__thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: opacity 0.2s; }
.moc-card__thumb:hover img { opacity: 0.85; }
.moc-card__title { font-family: var(--moc-serif); font-size: 17px; font-weight: 700; line-height: 1.3; margin: 6px 0; }
.moc-card__title a { color: var(--moc-ink); text-decoration: none; }
.moc-card__title a:hover { color: var(--moc-accent); }
.moc-no-thumb { background: var(--moc-bg-light); display: flex; align-items: center; justify-content: center; font-family: var(--moc-ui); font-size: 10px; color: var(--moc-muted); letter-spacing: 2px; text-transform: uppercase; }

/* ============================================================
   ARCHIVE / LIST PAGE COMPONENTS
   ============================================================ */
.moc-archive-header { padding: 24px 0 20px; border-bottom: 3px solid var(--moc-ink); margin-bottom: 28px; }
.moc-archive-header h1 { font-family: var(--moc-serif); font-size: clamp(22px, 4vw, 36px); font-weight: 700; color: var(--moc-ink); margin: 0 0 4px; }
.moc-archive-header p { font-family: var(--moc-body-font); font-size: 15px; font-style: italic; color: var(--moc-muted); margin: 0; }
.moc-archive-count { font-family: var(--moc-ui); font-size: 11px; color: var(--moc-muted); margin-top: 6px; display: block; }

.moc-list-card { display: grid; grid-template-columns: 200px 1fr; gap: 22px; padding: 24px 0; border-bottom: 1px solid var(--moc-rule); align-items: start; }
.moc-list-card:last-child { border-bottom: none; }
@media (max-width: 600px) { .moc-list-card { grid-template-columns: 1fr; } }
.moc-list-card__thumb { display: block; overflow: hidden; }
.moc-list-card__thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; transition: opacity 0.2s; }
.moc-list-card__thumb:hover img { opacity: 0.85; }
.moc-list-card__title { font-family: var(--moc-serif); font-size: clamp(17px, 2.5vw, 22px); font-weight: 700; line-height: 1.3; margin: 8px 0; }
.moc-list-card__title a { color: var(--moc-ink); text-decoration: none; }
.moc-list-card__title a:hover { color: var(--moc-accent); }
.moc-list-card__excerpt { font-family: var(--moc-body-font); font-size: 15px; line-height: 1.7; color: var(--moc-body); margin: 0 0 10px; }

/* Author archive header */
.moc-author-header { background: var(--moc-ink); padding: 40px 0; }
.moc-author-header-inner { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.moc-author-header img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,0.2); flex-shrink: 0; }
.moc-author-header h1 { font-family: var(--moc-serif); font-size: clamp(22px,4vw,34px); font-weight: 700; color: #fff; margin: 0 0 4px; }
.moc-author-header p { font-family: var(--moc-body-font); font-size: 15px; color: rgba(255,255,255,0.75); line-height: 1.65; margin: 0; max-width: 560px; }

/* ============================================================
   SINGLE ARTICLE
   ============================================================ */
.moc-article-header { margin-bottom: 24px; }
.moc-article-header h1 { font-family: var(--moc-serif); font-size: clamp(26px, 4.5vw, 42px); font-weight: 700; color: var(--moc-ink); line-height: 1.15; margin: 12px 0 14px; }
.moc-article-deck { font-family: var(--moc-body-font); font-size: 19px; font-weight: 300; line-height: 1.65; color: var(--moc-body); margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--moc-rule); }
.moc-article-meta { font-family: var(--moc-ui); font-size: 12px; color: var(--moc-muted); padding: 12px 0; border-top: 1px solid var(--moc-rule); border-bottom: 2px solid var(--moc-ink); margin-bottom: 28px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.moc-article-meta strong { color: var(--moc-ink); }
.moc-article-meta a { color: var(--moc-muted); text-decoration: none; }
.moc-article-meta a:hover { color: var(--moc-accent); }

/* Article body prose */
.moc-content { font-family: var(--moc-body-font); }
.moc-content p  { font-size: 17px; line-height: 1.85; color: var(--moc-body); margin: 0 0 1.4em; }
.moc-content h2 { font-family: var(--moc-serif); font-size: clamp(20px,2.5vw,26px); font-weight: 400; color: var(--moc-ink); margin: 1.8em 0 0.6em; }
.moc-content h3 { font-family: var(--moc-serif); font-size: 21px; font-weight: 400; color: var(--moc-ink); margin: 1.5em 0 0.5em; }
.moc-content ul, .moc-content ol { font-size: 17px; line-height: 1.75; color: var(--moc-body); padding-left: 1.5em; margin: 0 0 1.4em; }
.moc-content li { margin-bottom: 0.5em; }
.moc-content blockquote { border-left: 3px solid var(--moc-accent); margin: 1.5em 0; padding: 12px 22px; background: var(--moc-bg-light); }
.moc-content blockquote p { font-family: var(--moc-serif); font-size: 18px; font-style: italic; color: var(--moc-body); margin: 0; }
.moc-content figure { margin: 1.5em 0; }
.moc-content figure img { width: 100%; }
.moc-content figure figcaption { font-family: var(--moc-ui); font-size: 11px; color: #aaa; font-style: italic; padding: 5px 0; border-bottom: 1px solid #eee; }
.moc-content a { color: var(--moc-accent); border-bottom: 1px solid rgba(26,58,110,0.2); }
.moc-content a:hover { color: var(--moc-red); border-color: var(--moc-red); }
.moc-content strong { color: var(--moc-ink); }

/* Author box */
.moc-author-box { display: flex; gap: 18px; align-items: flex-start; padding: 22px 0; border-top: 2px solid var(--moc-ink); margin-top: 48px; }
.moc-author-box img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.moc-author-box__name  { font-family: var(--moc-ui); font-size: 14px; font-weight: 700; color: var(--moc-ink); display: block; margin-bottom: 2px; }
.moc-author-box__title { font-family: var(--moc-ui); font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--moc-red); display: block; margin-bottom: 8px; }
.moc-author-box__bio   { font-family: var(--moc-ui); font-size: 13px; color: var(--moc-muted); line-height: 1.65; margin: 0; }

/* Related posts */
.moc-related { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--moc-rule); }
.moc-related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 16px; }
@media (max-width: 640px) { .moc-related-grid { grid-template-columns: 1fr; } }
.moc-related-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 10px; }
.moc-related-card h4 { font-family: var(--moc-serif); font-size: 15px; font-weight: 700; line-height: 1.35; margin: 0 0 5px; }
.moc-related-card h4 a { color: var(--moc-ink); text-decoration: none; }
.moc-related-card h4 a:hover { color: var(--moc-accent); }

/* Post nav */
.moc-post-nav { display: flex; justify-content: space-between; padding: 24px 0; border-top: 1px solid var(--moc-rule); margin-top: 24px; font-family: var(--moc-ui); font-size: 13px; gap: 16px; flex-wrap: wrap; }
.moc-post-nav a { color: var(--moc-accent); text-decoration: none; max-width: 45%; }
.moc-post-nav a:last-child { text-align: right; margin-left: auto; }

/* ============================================================
   SIDEBAR WIDGETS
   ============================================================ */
.moc-sidebar-block { margin-bottom: 36px; padding-bottom: 36px; border-bottom: 1px solid var(--moc-rule); }
.moc-sidebar-block:last-child { border-bottom: none; padding-bottom: 0; }
.moc-sb-story { padding: 12px 0; border-bottom: 1px solid #eee; }
.moc-sb-story:last-child { border-bottom: none; }
.moc-sb-story h4 { font-family: var(--moc-serif); font-size: 15px; font-weight: 700; line-height: 1.35; margin: 4px 0; }
.moc-sb-story h4 a { color: var(--moc-ink); text-decoration: none; }
.moc-sb-story h4 a:hover { color: var(--moc-accent); }
.moc-sb-story-date { font-family: var(--moc-ui); font-size: 11px; color: var(--moc-muted); }
.moc-about-box { background: var(--moc-bg-light); padding: 20px; border-top: 3px solid var(--moc-accent); }
.moc-about-box p { font-family: var(--moc-body-font); font-size: 14px; line-height: 1.7; color: var(--moc-body); margin: 0 0 10px; }
.moc-about-box a { font-family: var(--moc-ui); font-size: 12px; font-weight: 600; color: var(--moc-accent); text-decoration: none; }

/* ============================================================
   PAGINATION
   ============================================================ */
.moc-pagination { display: flex; gap: 8px; align-items: center; padding: 32px 0; flex-wrap: wrap; }
.moc-pagination a, .moc-pagination span { font-family: var(--moc-ui); font-size: 13px; font-weight: 600; padding: 8px 14px; border: 1px solid var(--moc-rule); color: var(--moc-ink); text-decoration: none; transition: all 0.15s; display: inline-block; }
.moc-pagination a:hover, .moc-pagination .current { background: var(--moc-accent); color: #fff; border-color: var(--moc-accent); }

/* ============================================================
   SEARCH FORM
   ============================================================ */
.moc-search-form { display: flex; margin-bottom: 32px; }
.moc-search-form input[type="search"] { flex: 1; padding: 12px 16px; border: 1.5px solid var(--moc-rule); border-right: none; font-family: var(--moc-ui); font-size: 14px; outline: none; }
.moc-search-form input:focus { border-color: var(--moc-accent); }
.moc-search-form button { background: var(--moc-accent); color: #fff; border: none; padding: 12px 20px; font-family: var(--moc-ui); font-size: 12px; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: background 0.15s; }
.moc-search-form button:hover { background: var(--moc-ink); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .moc-card { grid-template-columns: 100px 1fr; gap: 14px; }
}
