:root {
  --bg: #F2EBE8;
  --accent: #8B2E3C;
  --ink: #221A1C;
  --ink-soft: #4E4145;
  --logo-black: #131011;
  --gutter: 16px;
  --font-head: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --shadow-image: 0 10px 18px -8px rgba(74, 28, 36, 0.45), 0 3px 6px -2px rgba(74, 28, 36, 0.25);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

#page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 env(safe-area-inset-bottom);
}

/* ---------- Masthead ---------- */

.masthead {
  position: relative;
  padding: calc(18px + env(safe-area-inset-top)) var(--gutter) 20px;
  display: flex;
  justify-content: center;
}

.logo {
  position: relative;
  margin: 0;
  padding-top: 0.3em;
  display: flex;
  flex-direction: column;
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.86;
  font-size: clamp(50px, 16vw, 92px);
}

.logo-top {
  color: var(--logo-black);
}

.logo-bottom {
  color: var(--accent);
  align-self: flex-end;
  margin-right: 6%;
  margin-top: 0.02em;
}

/* Swiss cross mark, top right, as on the round badge */
.logo-cross {
  position: absolute;
  top: 0;
  right: 1%;
  width: 0.46em;
  height: 0.46em;
  background: var(--accent);
  border-radius: 0.08em;
  box-shadow: 0 4px 8px -3px rgba(74, 28, 36, 0.5);
}

.logo-cross::before,
.logo-cross::after {
  content: "";
  position: absolute;
  background: #fff;
}

.logo-cross::before {
  left: 39%;
  top: 17%;
  width: 22%;
  height: 66%;
}

.logo-cross::after {
  left: 17%;
  top: 39%;
  width: 66%;
  height: 22%;
}

/* thin accent line beneath the masthead */
.masthead::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

/* ---------- Feed: global zigzag ---------- */

.feed {
  padding-top: 30px;
}

.story {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  grid-template-areas:
    "media head"
    "body  body";
  column-gap: 16px;
  row-gap: 14px;
  padding: 0 var(--gutter);
  margin-bottom: 40px;
  cursor: pointer;
}

/* image RIGHT: swap columns, mirror text */
.story--right {
  grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
  grid-template-areas:
    "head media"
    "body body";
  text-align: right;
}

.story--left { text-align: left; }

.story-media {
  grid-area: media;
  display: block;
  align-self: start;
}

.story-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  background: #E5D9D5;
  box-shadow: var(--shadow-image);
}

.story-head {
  grid-area: head;
  align-self: center;
}

.kicker {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.story-heading {
  margin: 0;
  font-size: inherit;
}

.story-title {
  display: block;
  width: 100%;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(17px, 4.8vw, 24px);
  line-height: 1.16;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-align: inherit;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.story-body {
  grid-area: body;
}

.story-preview {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  hyphens: auto;
  -webkit-hyphens: auto;
}

.story-more {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  padding: 6px 0;
}

.story:active .story-title,
.story-title:focus-visible,
.story-more:focus-visible {
  color: var(--accent);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

.footer {
  margin: 0 var(--gutter);
  padding: 22px 0 32px;
  border-top: 2px solid var(--accent);
  text-align: center;
}

.footer-name {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--logo-black);
}

.footer-sections {
  margin: 0;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Full-screen article overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.overlay[hidden] { display: none; }

.overlay:focus { outline: none; }

.overlay-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: var(--bg);
  border-bottom: 2px solid var(--accent);
}

.overlay-brand {
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--logo-black);
}

.overlay-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
}

.overlay-close:active { background: #6E2330; }

.overlay-close:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.overlay-close-x { font-size: 13px; }

.overlay-article {
  max-width: 680px;
  margin: 0 auto;
  padding: 26px var(--gutter) calc(48px + env(safe-area-inset-bottom));
}

.overlay-title {
  margin: 0 0 20px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.overlay-image {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: cover;
  border-radius: 3px;
  background: #E5D9D5;
  box-shadow: var(--shadow-image);
  margin: 0 0 26px;
}

.overlay-text p {
  margin: 0 0 1.15em;
  font-size: 18px;
  line-height: 1.68;
  color: var(--ink);
}

@media (min-width: 640px) {
  .story { column-gap: 24px; margin-bottom: 52px; }
  .story-preview { font-size: 17px; }
  .story-image { aspect-ratio: 3 / 2; }
}
