/*
Theme Name: Meridian Notes
Author: Alder Finch Studio
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: gp-theme
Description: A mobile-first classic WordPress theme for editorial PBN sites with dynamic menus, Customizer banner controls, and no hardcoded categories.
*/

:root {
  --gp-color-bg: #f4f1ea;
  --gp-color-surface: #fffaf1;
  --gp-color-text: #111111;
  --gp-color-muted: #6d675f;
  --gp-color-line: #1b1b1b;
  --gp-color-soft-line: rgba(17, 17, 17, 0.16);
  --gp-color-accent: #e24b2a;
  --gp-color-accent-soft: #f7d8cd;
  --gp-font-body: "Helvetica Neue", Arial, sans-serif;
  --gp-font-display: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --gp-site-pad: clamp(18px, 4vw, 54px);
  --gp-radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--gp-color-bg);
  color: var(--gp-color-text);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    var(--gp-color-bg);
  background-size: 42px 42px;
  color: var(--gp-color-text);
  font-family: var(--gp-font-body);
  line-height: 1.55;
  text-rendering: geometricPrecision;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--gp-color-accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.gp-screen-reader-text,
.gp-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gp-skip-link:focus {
  top: 12px;
  left: 12px;
  z-index: 999;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  border: 1px solid var(--gp-color-line);
  background: var(--gp-color-surface);
  color: var(--gp-color-text);
}

.gp-site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--gp-color-line);
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(16px);
}

.gp-header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  width: 100%;
  padding: 14px var(--gp-site-pad);
}

.gp-brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.gp-logo-link,
.gp-site-title {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  color: var(--gp-color-text);
  font-family: var(--gp-font-display);
  font-size: clamp(1.25rem, 5vw, 2.15rem);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
}

.gp-custom-logo {
  width: auto;
  max-width: min(210px, 48vw);
  max-height: 58px;
  object-fit: contain;
}

.gp-site-description {
  max-width: 42ch;
  margin: 0;
  color: var(--gp-color-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.gp-menu-toggle {
  display: inline-flex;
  width: 48px;
  height: 48px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--gp-color-line);
  border-radius: var(--gp-radius);
  background: var(--gp-color-surface);
  color: var(--gp-color-text);
}

.gp-menu-toggle-bar {
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.gp-menu-toggle[aria-expanded="true"] .gp-menu-toggle-bar:first-of-type {
  transform: translateY(8px) rotate(45deg);
}

.gp-menu-toggle[aria-expanded="true"] .gp-menu-toggle-bar:nth-of-type(2) {
  opacity: 0;
}

.gp-menu-toggle[aria-expanded="true"] .gp-menu-toggle-bar:last-of-type {
  transform: translateY(-8px) rotate(-45deg);
}

.gp-primary-nav {
  grid-column: 1 / -1;
  border-top: 1px solid var(--gp-color-soft-line);
}

.gp-js .gp-primary-nav {
  display: none;
}

.gp-js .gp-nav-open .gp-primary-nav {
  display: block;
}

.gp-nav-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 10px 0 0;
  list-style: none;
}

.gp-menu-item {
  margin: 0;
}

.gp-nav-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gp-color-soft-line);
  color: var(--gp-color-text);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.gp-menu-item-current > .gp-nav-link {
  color: var(--gp-color-accent);
}

.gp-sub-menu {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 0 14px;
  list-style: none;
}

.gp-main {
  width: 100%;
}

.gp-hero {
  display: grid;
  gap: 28px;
  min-height: calc(100svh - 82px);
  padding: clamp(34px, 7vw, 82px) var(--gp-site-pad) 28px;
}

.gp-hero-copy {
  display: grid;
  gap: 22px;
  align-content: start;
}

.gp-section-mark {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: var(--gp-color-accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gp-hero-title {
  max-width: 11ch;
  margin: 0;
  font-family: var(--gp-font-display);
  font-size: clamp(4.1rem, 22vw, 14rem);
  font-weight: 900;
  line-height: 0.78;
  text-transform: uppercase;
  word-break: break-word;
}

.gp-hero-intro {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(1.05rem, 3vw, 1.55rem);
  font-weight: 700;
  line-height: 1.15;
}

.gp-hero-panel {
  display: grid;
  gap: 12px;
  align-self: end;
}

.gp-hero-image-link,
.gp-hero-empty {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border: 1px solid var(--gp-color-line);
  background: var(--gp-color-surface);
}

.gp-hero-image {
  width: 100%;
  height: clamp(330px, 58vw, 620px);
  object-fit: cover;
  filter: saturate(0.9) contrast(1.03);
}

.gp-hero-empty {
  display: grid;
  place-items: center;
  padding: 32px;
  color: var(--gp-color-muted);
  text-align: center;
}

.gp-hero-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--gp-color-line);
  padding-top: 12px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gp-hero-meta-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gp-posts-section,
.gp-archive-section {
  padding: clamp(40px, 8vw, 94px) var(--gp-site-pad);
}

.gp-section-head {
  display: grid;
  gap: 12px;
  margin-bottom: 26px;
}

.gp-section-title {
  max-width: 10ch;
  margin: 0;
  font-family: var(--gp-font-display);
  font-size: clamp(2.8rem, 13vw, 7.6rem);
  font-weight: 900;
  line-height: 0.84;
  text-transform: uppercase;
}

.gp-section-copy {
  max-width: 48ch;
  margin: 0;
  color: var(--gp-color-muted);
  font-weight: 700;
}

.gp-post-grid {
  display: grid;
  gap: 18px;
}

.gp-post-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--gp-color-line);
  background: rgba(255, 250, 241, 0.72);
}

.gp-post-card:hover .gp-post-image {
  transform: scale(1.035);
}

.gp-post-image-link,
.gp-post-image-empty {
  display: block;
  overflow: hidden;
  min-height: 220px;
  border-bottom: 1px solid var(--gp-color-line);
  background: var(--gp-color-accent-soft);
}

.gp-post-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 240ms ease;
}

.gp-post-image-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  color: var(--gp-color-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.gp-post-card-body {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 28px);
}

.gp-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  color: var(--gp-color-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gp-post-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gp-post-topic {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--gp-color-soft-line);
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--gp-color-text);
}

.gp-post-title {
  margin: 0;
  font-family: var(--gp-font-display);
  font-size: clamp(1.85rem, 8vw, 4.8rem);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.gp-post-excerpt {
  margin: 0;
  color: var(--gp-color-muted);
  font-size: 1rem;
  font-weight: 650;
}

.gp-read-link,
.gp-back-link,
.gp-post-nav-link {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gp-color-line);
  border-radius: var(--gp-radius);
  padding: 10px 14px;
  background: var(--gp-color-text);
  color: var(--gp-color-bg);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gp-read-link:hover,
.gp-read-link:focus-visible,
.gp-back-link:hover,
.gp-back-link:focus-visible,
.gp-post-nav-link:hover,
.gp-post-nav-link:focus-visible {
  background: var(--gp-color-accent);
  color: var(--gp-color-surface);
}

.gp-empty-state {
  border: 1px solid var(--gp-color-line);
  padding: clamp(24px, 6vw, 44px);
  background: var(--gp-color-surface);
  color: var(--gp-color-muted);
  font-weight: 700;
}

.gp-single-shell {
  width: 80vw;
  max-width: none;
  margin: 0 auto;
  padding: clamp(34px, 8vw, 88px) 0;
}

.gp-single-header {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(28px, 6vw, 56px);
  border-bottom: 1px solid var(--gp-color-line);
  padding-bottom: clamp(24px, 5vw, 42px);
}

.gp-single-title {
  margin: 0;
  font-family: var(--gp-font-display);
  font-size: clamp(3.2rem, 14vw, 9.5rem);
  font-weight: 900;
  line-height: 0.82;
  text-transform: uppercase;
  word-break: break-word;
}

.gp-single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  color: var(--gp-color-muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gp-content {
  color: var(--gp-color-text);
  font-size: clamp(1.04rem, 2.2vw, 1.22rem);
}

.gp-content > * {
  margin-top: 0;
  margin-bottom: 1.35em;
}

.gp-content h2,
.gp-content h3,
.gp-content h4 {
  margin-top: 1.35em;
  font-family: var(--gp-font-display);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
}

.gp-content h2 {
  font-size: clamp(2rem, 7vw, 4.4rem);
}

.gp-content h3 {
  font-size: clamp(1.6rem, 5vw, 3rem);
}

.gp-content p,
.gp-content li {
  color: #27231f;
}

.gp-content a {
  color: var(--gp-color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.gp-content blockquote {
  margin-left: 0;
  border-left: 4px solid var(--gp-color-accent);
  padding-left: 18px;
  color: var(--gp-color-muted);
  font-size: 1.2em;
  font-weight: 750;
}

.gp-content img {
  height: auto;
  border: 1px solid var(--gp-color-line);
}

.gp-content table {
  width: 100%;
  border-collapse: collapse;
}

.gp-content th,
.gp-content td {
  border: 1px solid var(--gp-color-soft-line);
  padding: 10px;
  text-align: left;
}

.gp-content pre {
  overflow-x: auto;
  border: 1px solid var(--gp-color-line);
  padding: 18px;
  background: #171717;
  color: #f8f3eb;
}

.gp-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.gp-post-navigation {
  display: grid;
  gap: 12px;
  margin-top: clamp(34px, 6vw, 62px);
  border-top: 1px solid var(--gp-color-line);
  padding-top: 24px;
}

.gp-site-footer {
  border-top: 1px solid var(--gp-color-line);
  padding: clamp(32px, 7vw, 72px) var(--gp-site-pad);
  background: #111111;
  color: var(--gp-color-bg);
}

.gp-footer-grid {
  display: grid;
  gap: 28px;
}

.gp-footer-title {
  max-width: 9ch;
  margin: 0;
  font-family: var(--gp-font-display);
  font-size: clamp(2.4rem, 12vw, 7rem);
  font-weight: 900;
  line-height: 0.82;
  text-transform: uppercase;
}

.gp-footer-kicker,
.gp-footer-label,
.gp-footer-copy {
  margin: 0;
}

.gp-footer-kicker,
.gp-footer-label {
  color: var(--gp-color-accent-soft);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gp-footer-copy {
  color: rgba(244, 241, 234, 0.7);
  font-size: 0.92rem;
  font-weight: 700;
}

.gp-footer-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.gp-footer-link {
  color: var(--gp-color-bg);
  font-size: 0.9rem;
  font-weight: 850;
  text-transform: uppercase;
}

.gp-footer-link:hover,
.gp-footer-link:focus-visible {
  color: var(--gp-color-accent-soft);
}

.gp-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 38px;
  border-top: 1px solid rgba(244, 241, 234, 0.2);
  padding-top: 16px;
  color: rgba(244, 241, 234, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

@media (min-width: 720px) {
  .gp-header-inner {
    grid-template-columns: auto 1fr;
  }

  .gp-menu-toggle {
    display: none;
  }

  .gp-primary-nav,
  .gp-js .gp-primary-nav {
    display: block;
    grid-column: auto;
    border-top: 0;
  }

  .gp-nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
  }

  .gp-nav-link {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: var(--gp-radius);
    padding: 9px 12px;
  }

  .gp-nav-link:hover,
  .gp-nav-link:focus-visible,
  .gp-menu-item-current > .gp-nav-link {
    border-color: var(--gp-color-line);
    background: var(--gp-color-surface);
  }

  .gp-menu-item-parent {
    position: relative;
  }

  .gp-menu-item-parent:hover > .gp-sub-menu,
  .gp-menu-item-parent:focus-within > .gp-sub-menu {
    display: grid;
  }

  .gp-sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    min-width: 220px;
    border: 1px solid var(--gp-color-line);
    padding: 8px;
    background: var(--gp-color-surface);
  }

  .gp-sub-menu .gp-nav-link {
    justify-content: flex-start;
  }

  .gp-hero {
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
    align-items: stretch;
  }

  .gp-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gp-post-card:first-child {
    grid-column: span 2;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  }

  .gp-post-card:first-child .gp-post-image-link,
  .gp-post-card:first-child .gp-post-image-empty {
    border-right: 1px solid var(--gp-color-line);
    border-bottom: 0;
  }

  .gp-post-card:first-child .gp-post-image {
    height: 100%;
    min-height: 420px;
  }

  .gp-post-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gp-footer-grid {
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(180px, 0.5fr));
  }
}

@media (min-width: 1120px) {
  .gp-post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gp-post-card:first-child {
    grid-column: span 2;
  }
}
