:root{
    --paper: #EDEAE0;
    --paper-alt: #E1D8C2;
    --ink: #232620;
    --ink-soft: #565b4e;
    --rule: #c9c2ae;
    --ochre: #A6472B;
    --green: #2F5233;
    --blue: #1E4A5F;
    --gold: #B98A2E;
    --plum: #6B3550;
    --card-bg: #F7F4EA;
    --shadow: rgba(35,38,32,0.20);
    --font-display: 'Fraunces', serif;
    --font-body: 'Public Sans', sans-serif;
  }

  *{ box-sizing: border-box; }

  html{ scroll-behavior: smooth; }

  body{
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.5;
  }

  a{ color: var(--ochre); }

  :focus-visible{
    outline: 2px solid var(--ochre);
    outline-offset: 3px;
  }

  .wrap{
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 28px;
  }

  /* ---------- Masthead ---------- */

  .masthead{
    padding: 22px 0 20px;
    border-bottom: 3px solid var(--ink);
  }

  .masthead-top{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 14px;
  }

  .wordmark{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1;
  }

  .site-logo{
    display: block;
    height: auto;
    width: clamp(220px, 32vw, 340px);
    mix-blend-mode: multiply;
  }

  .tagline{
    margin: 10px 0 0;
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 46ch;
  }

  /* ---------- Nav / filters ---------- */

  .topnav{
    position: sticky;
    top: 0;
    background: var(--paper);
    z-index: 20;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .filters{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .chip{
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--ink);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .chip:hover{ background: rgba(35,38,32,0.06); }

  .chip.active{
    background: var(--ink);
    color: var(--paper);
  }

  .nav-tools{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-tools select,
  .nav-tools input[type="search"]{
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--rule);
    background: var(--card-bg);
    color: var(--ink);
  }

  .nav-tools input[type="search"]{ width: 190px; }

  /* ---------- Hero ---------- */

  .hero{
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 48px;
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--rule);
  }

  @media (prefers-reduced-motion: no-preference){
    .hero-story{
      animation: rise 0.6s ease both;
    }
    @keyframes rise{
      from{ opacity: 0; transform: translateY(14px); }
      to{ opacity: 1; transform: translateY(0); }
    }
  }

  .pill{
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--pill-color, var(--ochre));
    color: #fff;
    margin-bottom: 14px;
  }

  .hero-photo{
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 24px -12px var(--shadow);
  }

  .hero-photo img{
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .pill.outline{
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--ink-soft);
  }

  .hero-story h2{
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.6vw, 2.7rem);
    line-height: 1.12;
    margin: 0 0 16px;
    max-width: 20ch;
  }

  .hero-story h2 a,
  .pin-card h4 a{
    color: inherit;
    text-decoration: none;
  }

  .dek{
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 58ch;
    margin: 0 0 14px;
  }

  .byline{
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-style: italic;
  }

  .ticker h3{
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
    margin: 6px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
  }

  .ticker ul{ list-style: none; margin: 0; padding: 0; }

  .ticker li{
    padding: 12px 0;
    border-bottom: 1px dashed var(--rule);
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  .ticker li:first-child{ padding-top: 0; }

  .ticker-thumb{
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px -2px var(--shadow);
  }

  .ticker-text{ min-width: 0; }

  .ticker a{
    font-family: var(--font-display);
    font-size: 1.02rem;
    color: var(--ink);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
  }

  .ticker a:hover{ color: var(--ochre); }

  .ticker .meta{
    font-size: 0.78rem;
    color: var(--ink-soft);
  }

  /* ---------- Corkboard ---------- */

  .section-title{
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 6px;
  }

  .section-sub{
    color: var(--ink-soft);
    margin: 0 0 26px;
    font-size: 0.95rem;
  }

  .corkboard-section{ padding: 48px 0; }

  .corkboard{
    background: var(--paper-alt);
    background-image: repeating-linear-gradient(135deg, rgba(35,38,32,0.035) 0px, rgba(35,38,32,0.035) 1px, transparent 1px, transparent 7px);
    border-radius: 10px;
    padding: 34px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px 26px;
  }

  .status-line{
    font-size: 0.9rem;
    color: var(--ink-soft);
    grid-column: 1 / -1;
  }

  .pin-card{
    position: relative;
    background: var(--card-bg);
    border-radius: 3px;
    padding: 26px 20px 20px;
    box-shadow: 0 8px 18px -8px var(--shadow);
    transform: rotate(var(--rot, 0deg));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .pin-card:hover{
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 0 14px 24px -10px var(--shadow);
  }

  @media (prefers-reduced-motion: no-preference){
    .pin-card.just-pinned{
      animation: pinIn 0.45s cubic-bezier(.2,1.4,.4,1) both;
    }
    @keyframes pinIn{
      from{ opacity: 0; transform: scale(0.85) rotate(0deg); }
      to{ opacity: 1; transform: scale(1) rotate(var(--rot, 0deg)); }
    }
  }

  .pin-dot{
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--dot-color, var(--ochre));
    box-shadow: 0 2px 4px rgba(0,0,0,0.35);
  }

  .card-photo{
    background: #fff;
    padding: 8px 8px 0;
    margin: 6px 0 14px;
    box-shadow: 0 3px 10px -3px var(--shadow);
  }

  .card-photo img{
    width: 100%;
    display: block;
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }

  .card-photo .photo-caption{
    font-size: 0.72rem;
    color: var(--ink-soft);
    text-align: center;
    padding: 6px 4px 10px;
    font-style: italic;
  }

  .pin-card .pills{ margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

  .pin-card h4{
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.25;
    margin: 0 0 10px;
  }

  .card-excerpt, .card-full{
    font-size: 0.92rem;
    color: var(--ink-soft);
    margin: 0 0 10px;
  }

  .card-full{ display: none; }

  .pin-card.open .card-excerpt{ display: none; }
  .pin-card.open .card-full{ display: block; }

  .card-author{
    font-size: 0.8rem;
    font-style: italic;
    color: var(--ink-soft);
    margin: 0 0 10px;
  }

  .read-toggle{
    display: inline-block;
    background: var(--ochre);
    color: #fff;
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    margin: 6px 0 4px;
    transition: background 0.15s ease;
  }

  .read-toggle:hover{ background: #8c3b23; }

  /* ---------- Submit section ---------- */

  .submit-section{
    padding: 48px 0 56px;
    border-top: 1px solid var(--rule);
  }

  .submit-note{
    color: var(--ink-soft);
    font-size: 0.92rem;
    max-width: 60ch;
    margin: 0 0 28px;
  }

  form{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
    max-width: 720px;
  }

  .field{ display: flex; flex-direction: column; gap: 6px; }
  .field.full{ grid-column: 1 / -1; }

  label{ font-size: 0.85rem; font-weight: 600; }

  input[type="text"], select, textarea{
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1.5px solid var(--rule);
    background: var(--card-bg);
    color: var(--ink);
  }

  textarea{ resize: vertical; min-height: 100px; }

  .submit-btn{
    grid-column: 1 / -1;
    justify-self: start;
    background: var(--ochre);
    color: #fff;
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.98rem;
    padding: 12px 26px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .submit-btn:hover{ background: #8c3b23; }

  input[type="file"]{
    font-family: var(--font-body);
    font-size: 0.85rem;
  }

  .field-hint{
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin: -4px 0 0;
  }

  #formStatus{
    grid-column: 1 / -1;
    font-size: 0.9rem;
    min-height: 1.2em;
    color: var(--green);
  }

  #formStatus.error{ color: var(--ochre); }

  /* ---------- Footer ---------- */

  footer{
    border-top: 3px solid var(--ink);
    padding: 30px 0 40px;
    color: var(--ink-soft);
    font-size: 0.88rem;
  }

  .footer-wordmark{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 8px;
  }

  .footer-links{ margin: 10px 0; }

  .footer-editor{
    margin: 16px 0;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    line-height: 1.6;
  }

  @media (max-width: 760px){
    .hero{ grid-template-columns: 1fr; }
    form{ grid-template-columns: 1fr; }
    .nav-tools input[type="search"]{ width: 140px; }
  }


  /* ---------- Social actions (like / share) ---------- */

  .social-row{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
  }

  .fb-like{
    min-width: 100px;
    min-height: 20px;
  }

  .fb-like span, .fb-like iframe{
    min-width: 100px !important;
    min-height: 20px !important;
  }

  .social-btn{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--rule);
    background: var(--card-bg);
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .social-btn:hover{
    border-color: var(--blue);
    background: #eef4f6;
  }

  .social-btn.like-btn:hover{ border-color: var(--ochre); background: #f7ece8; }

  .social-btn svg{ width: 15px; height: 15px; flex: none; }

  /* ---------- Standalone story page ---------- */

  .article-page{ padding: 32px 0 64px; }

  .article-back{
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
  }

  .article-photo{
    margin: 18px 0 22px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 10px 24px -12px var(--shadow);
  }

  .article-photo img{ width: 100%; display: block; }

  .article-photo .photo-caption{
    margin: 0;
    padding: 8px 12px;
    background: var(--card-bg);
    font-size: 0.8rem;
    color: var(--ink-soft);
  }

  .article-headline{
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.15;
    margin: 14px 0 10px;
  }

  .article-byline{
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin: 0 0 22px;
  }

  .article-body p{
    font-size: 1.02rem;
    line-height: 1.7;
    margin: 0 0 18px;
    max-width: 68ch;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
  }

  .article-social{
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
  }


  /* ---------- Article headings & references (added for long-form stories) ---------- */

  .article-body h3{
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.25;
    margin: 30px 0 10px;
  }

  .article-references{
    margin: 32px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
  }

  .article-references h3{
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 14px;
  }

  .article-references ol{
    margin: 0;
    padding-left: 1.3em;
  }

  .article-references li{
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--ink-soft);
    margin-bottom: 10px;
    max-width: 68ch;
  }

  .article-references a{ color: inherit; }
