/*
Theme Name:  Center Maryland
Theme URI:   https://centermaryland.com
Description: Custom theme for Center Maryland — clean landing page with newsletter subscribe and article publishing.
Version:     1.2.0
Author:      Center Maryland
Text Domain: center-maryland
*/

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:      #1a1a1a;
  --maroon:     #8B1A1A;
  --maroon-dk:  #6e1414;
  --gold:       #F5C200;
  --white:      #ffffff;
  --off-white:  #f8f7f5;
  --text:       #222222;
  --text-muted: #666666;
  --border:     #e2e0dc;

  --font-sans:  'Helvetica Neue', Arial, Helvetica, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --max-width: 860px;
  --gutter:    24px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-serif);
  color: var(--text);
  background: var(--white);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a   { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-dk); text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.2;
  color: var(--black);
}

p { margin-bottom: 1.3em; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   Homepage — two-column layout
   ============================================================ */

/* Lock the homepage to viewport height so columns fill the screen */
body.home {
  overflow: hidden;
}

.home-page {
  height: 100vh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  background: var(--white);
}

/* ── Left column (50%) ── */
.home-left {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 48px;
  text-align: center;
  border-right: 1px solid var(--border);
  background: var(--white);
  overflow-y: auto;
}

.home-logo {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 36px;
}

.home-logo img {
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Fallback text logo if image not set */
.home-logo-text {
  font-family: var(--font-sans);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}
.home-logo-text .line-center   { color: var(--black); display: block; }
.home-logo-text .line-maryland { color: var(--maroon); display: block; }

.home-divider {
  width: 48px;
  height: 4px;
  background: var(--gold);
  margin: 0 auto 28px;
  border: none;
}

.home-intro {
  max-width: 360px;
  margin: 0 auto 36px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.subscribe-btn {
  display: block;
  background: var(--maroon);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 15px 36px;
  border-radius: 2px;
  transition: background 0.2s;
  text-decoration: none;
  text-align: center;
}
.subscribe-btn:hover {
  background: var(--maroon-dk);
  color: var(--white);
  text-decoration: none;
}
.btn-stack {
  width: 100%;
}
.btn-stack .subscribe-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.btn-stack .subscribe-btn + .subscribe-btn {
  margin-top: 12px;
}
.subscribe-btn--secondary {
  background: transparent;
  color: var(--maroon);
  border: 2px solid var(--maroon);
}
.subscribe-btn--secondary:hover {
  background: var(--maroon);
  color: var(--white);
}

.home-footer-note {
  margin-top: 40px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: #aaa;
  letter-spacing: 0.04em;
}

.home-social {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
}

.social-icon {
  color: #c8c8c8;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  text-decoration: none;
}
.social-icon:hover {
  color: #888;
  text-decoration: none;
}

.home-about-link {
  display: block;
  padding: 16px 0 8px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: #bbb;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  transition: color 0.2s;
}
.home-about-link:hover {
  color: var(--maroon);
  text-decoration: none;
}

.ko-credit {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ko-credit-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: #aaa;
  letter-spacing: 0.04em;
}
.ko-logo {
  height: 28px;
  width: auto;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.ko-credit a:hover .ko-logo {
  opacity: 1;
}

/* ── Right column (50%) ── */
.home-right {
  width: 50%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--off-white);
}

.home-right--empty {
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

/* Fixed-height header bar — 48px lets us calc() the iframe */
.home-right-header {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.latest-issue-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.latest-issue-date {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
}

.latest-issue-link {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--maroon);
  text-decoration: none;
  white-space: nowrap;
}
.latest-issue-link:hover {
  color: var(--maroon-dk);
  text-decoration: none;
}

/* Iframe container — fills remaining height exactly */
.newsletter-preview {
  position: relative;
  height: calc(100vh - 48px);
  overflow: hidden;
}

/* Iframe fills the container absolutely — avoids height:100% inheritance issues */
.newsletter-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #f0f0f0;
  display: block;
}

/* ============================================================
   Article pages — Header
   ============================================================ */
.site-header {
  border-bottom: 3px solid var(--gold);
  padding: 20px var(--gutter);
  text-align: center;
}

.header-logo {
  display: inline-block;
  text-decoration: none;
}
.header-logo img {
  height: 52px;
  width: auto;
  margin: 0 auto;
}
.header-logo-text {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.header-logo-text .line-center   { color: var(--black); display: block; }
.header-logo-text .line-maryland { color: var(--maroon); display: block; }

/* ============================================================
   Article pages — Content
   ============================================================ */
.article-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px var(--gutter) 80px;
}

.article-meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--black);
  margin-bottom: 32px;
  line-height: 1.2;
}

.article-divider {
  width: 48px;
  height: 4px;
  background: var(--maroon);
  border: none;
  margin-bottom: 40px;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
}
.article-content p   { margin-bottom: 1.5em; }
.article-content h2  { font-size: 1.4rem; margin: 2em 0 0.6em; }
.article-content h3  { font-size: 1.15rem; margin: 1.8em 0 0.5em; }
.article-content a   { color: var(--maroon); font-weight: 600; }
.article-content a:hover { color: var(--maroon-dk); }
.article-content blockquote {
  border-left: 4px solid var(--gold);
  margin: 2em 0;
  padding: 12px 0 12px 24px;
  font-style: italic;
  color: var(--black);
  font-size: 1.1rem;
}
.article-content ul,
.article-content ol  { padding-left: 1.5em; margin-bottom: 1.5em; }
.article-content li  { margin-bottom: 0.4em; }
.article-content img { margin: 2em auto; border-radius: 2px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 48px;
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--maroon); text-decoration: none; }
.back-link::before { content: '←'; font-size: 1em; }

/* ============================================================
   Article pages — Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px var(--gutter);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: #aaa;
  letter-spacing: 0.04em;
}

/* ============================================================
   About page
   ============================================================ */
.about-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px var(--gutter) 80px;
}

.about-header {
  margin-bottom: 40px;
}

.about-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--black);
  margin-bottom: 28px;
  line-height: 1.2;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  /* Stack columns vertically on smaller screens */
  .home-page {
    flex-direction: column;
    align-items: stretch;
  }

  .home-left {
    width: 100%;
    min-width: 0;
    padding: 48px 24px 36px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .home-right {
    min-height: 520px;
  }

  .newsletter-frame {
    min-height: 520px;
  }
}

@media (max-width: 480px) {
  .home-left { padding: 40px 20px 32px; }
  .home-logo  { max-width: 220px; }
  .article-wrap { padding: 40px 20px 60px; }
  .header-logo img { height: 40px; }
}
