/* =========================================================================
   The Gloss Journal — Editorial Stylesheet
   ========================================================================= */

:root {
  --bg:        #f6f2ec;   /* warm bone            */
  --surface:   #fffdfa;   /* card / paper         */
  --ink:       #1b1613;   /* near-black text      */
  --muted:     #6d635a;   /* secondary text       */
  --faint:     #a89f94;   /* captions / meta      */
  --line:      #e4dbcd;   /* hairline rules       */
  --accent:    #9c6b58;   /* muted terracotta     */
  --accent-2:  #b98d7d;   /* soft accent          */
  --shadow:    0 24px 60px -32px rgba(40, 28, 20, .35);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --maxw: 1200px;
  --read: 42rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }

/* ---- little uppercase labels ------------------------------------------- */
.label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.label--muted { color: var(--faint); }

/* =========================================================================
   Masthead
   ========================================================================= */
.masthead { padding-top: 26px; }

.masthead__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 20px;
}

.masthead__brand { text-align: center; padding: 14px 0 6px; }

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: .95;
  font-size: clamp(40px, 8vw, 84px);
  color: var(--ink);
  display: inline-block;
}
.wordmark span { font-style: italic; font-weight: 500; }

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 2.4vw, 20px);
  color: var(--muted);
  margin-top: 6px;
}

.topnav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(16px, 4vw, 40px);
  margin-top: 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.topnav a { position: relative; }
.topnav a:hover { color: var(--accent); }

/* =========================================================================
   Lead feature
   ========================================================================= */
.lead {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(36px, 6vw, 64px) 0;
  border-bottom: 1px solid var(--line);
}
.lead__media {
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}
.lead__media svg { width: 100%; height: 100%; }
.lead__body { max-width: 34rem; }
.lead__title {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.02;
  font-size: clamp(34px, 5.2vw, 58px);
  margin: 14px 0 16px;
  letter-spacing: -0.01em;
}
.lead__title a:hover { color: var(--accent); }
.lead__excerpt { font-size: 18px; color: var(--muted); margin: 0 0 20px; }

/* =========================================================================
   Grid of stories
   ========================================================================= */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(40px, 6vw, 64px) 0 22px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 34px);
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 3.5vw, 48px) clamp(24px, 3vw, 40px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.card { display: flex; flex-direction: column; }
.card__media {
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 5 / 4;
  box-shadow: 0 18px 40px -30px rgba(40,28,20,.4);
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.card:hover .card__media { transform: translateY(-4px); }
.card__media svg { width: 100%; height: 100%; }
.card__kicker { display: flex; gap: 12px; align-items: center; margin: 16px 0 8px; }
.card__title {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  font-size: clamp(21px, 2.4vw, 26px);
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.card__excerpt { color: var(--muted); font-size: 15.5px; margin: 0 0 12px; }
.card__meta { margin-top: auto; font-size: 12px; color: var(--faint); letter-spacing: .04em; }

/* =========================================================================
   Article
   ========================================================================= */
.article { padding: clamp(28px, 5vw, 56px) 0 0; }
.article__head { max-width: var(--read); margin: 0 auto; text-align: center; }
.article__title {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.03;
  font-size: clamp(34px, 6vw, 64px);
  letter-spacing: -0.015em;
  margin: 14px 0 18px;
}
.article__dek {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.6vw, 24px);
  color: var(--muted);
  margin: 0 auto 22px;
  max-width: 34rem;
}
.byline {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}
.byline b { color: var(--muted); font-weight: 600; }
.byline .dot { color: var(--line); }

.article__hero {
  margin: clamp(28px, 5vw, 52px) auto;
  max-width: var(--maxw);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}
.article__hero svg { width: 100%; height: 100%; }

.prose { max-width: var(--read); margin: 0 auto; padding-bottom: 40px; }
.prose p { margin: 0 0 1.35em; }
.prose p.lede::first-letter {
  font-family: var(--serif);
  font-weight: 600;
  float: left;
  font-size: 4.6em;
  line-height: .72;
  padding: .06em .12em 0 0;
  color: var(--accent);
}
.prose h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.12;
  margin: 1.8em 0 .5em;
}
.prose ul { padding-left: 1.1em; margin: 0 0 1.35em; }
.prose li { margin-bottom: .5em; }

.pullquote {
  font-family: var(--serif);
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.22;
  color: var(--ink);
  text-align: center;
  margin: 1.6em auto;
  max-width: 32rem;
  padding: .4em 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pullquote span { color: var(--accent); font-style: italic; }

.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 22px 26px;
  margin: 2em 0;
}
.note .label { display: block; margin-bottom: 8px; }
.note p { margin: 0; color: var(--muted); font-size: 16px; }

.article__footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  text-align: center;
}
.back-link { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.back-link:hover { color: var(--accent); }

/* related */
.related { border-top: 1px solid var(--line); padding: clamp(40px,6vw,72px) 0; }

/* =========================================================================
   Legal / static content pages
   ========================================================================= */
.legal { padding: clamp(30px, 5vw, 56px) 0 clamp(48px, 7vw, 88px); }
.legal__inner { max-width: var(--read); margin: 0 auto; }
.legal h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 56px);
  margin: 0 0 6px;
}
.legal__updated { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 30px; }
.legal-content h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(21px, 3vw, 28px);
  margin: 1.6em 0 .4em;
}
.legal-content p { margin: 0 0 1.15em; color: var(--muted); }
.legal-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal__img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em 0;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.legal__placeholder {
  background: var(--surface);
  border: 1px dashed var(--accent-2);
  border-radius: 4px;
  padding: 18px 22px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding: clamp(40px, 6vw, 72px) 0 48px;
}
.site-footer__grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 28px;
}
.site-footer__brand .wordmark { font-size: clamp(28px, 4vw, 40px); }
.site-footer__brand p { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 17px; margin: 6px 0 0; }
.footer-nav { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-nav h4 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; font-weight: 600; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.footer-nav a:hover { color: var(--accent); }
.site-footer__legal {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--faint);
  letter-spacing: .04em;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .lead { grid-template-columns: 1fr; }
  .lead__media { order: -1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .masthead__meta span:nth-child(2) { display: none; }
}

/* =========================================================================
   Admin dashboard (scoped with .admin)
   ========================================================================= */
.admin { background: #efe9df; min-height: 100vh; }
.admin__bar {
  background: var(--ink);
  color: #f6f2ec;
  padding: 14px clamp(20px, 5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.admin__bar .wordmark { font-size: 24px; color: #f6f2ec; }
.admin__bar small { color: #b7aca0; opacity:.85; letter-spacing:.14em; text-transform:uppercase; font-size:11px; }
.admin__shell { max-width: 1180px; margin: 0 auto; padding: clamp(20px, 4vw, 40px); }
.admin__tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.admin__tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 10px 20px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .2s;
}
.admin__tab.is-active { background: var(--ink); color: #f6f2ec; border-color: var(--ink); }
.admin__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.admin__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
}
.admin__panel h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 4px; font-weight: 600; }
.admin__panel .hint { font-size: 13px; color: var(--faint); margin: 0 0 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffdfa;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
}
.field textarea { min-height: 420px; line-height: 1.6; font-size: 14.5px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }
.admin__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 11px 20px; border-radius: 5px; cursor: pointer; border: 1px solid var(--ink);
  background: var(--ink); color: #f6f2ec; transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.admin__status { font-size: 13px; color: var(--accent); min-height: 20px; margin-top: 12px; }
.admin__preview .legal-content { font-size: 15px; }
.admin__preview .legal__inner { max-width: none; }
.syntax-help { font-size: 12.5px; color: var(--faint); background: #f1ece3; border-radius: 5px; padding: 12px 14px; margin-top: 6px; line-height: 1.6; }
.syntax-help code { background: #e4dbcd; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.admin__note {
  background: #f1ece3; border: 1px solid var(--line); border-radius: 6px;
  padding: 16px 20px; margin-bottom: 22px; font-size: 13.5px; color: var(--muted);
}
.admin__note b { color: var(--ink); }

@media (max-width: 820px) {
  .admin__cols { grid-template-columns: 1fr; }
  .field textarea { min-height: 260px; }
}
