:root {
  --paper: #f4f0e8;
  --paper-light: #fbf9f4;
  --ink: #222521;
  --muted: #6c7069;
  --green: #183c32;
  --green-soft: #dce6df;
  --coral: #e35a42;
  --line: #d8d4ca;
  --white: #fffdf8;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans), Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
  font: inherit;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50% 50% 50% 12%;
  background: var(--coral);
  color: var(--white);
  font-family: var(--font-serif), Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  transform: rotate(-3deg);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #f5a493;
}

.muted {
  color: var(--muted);
}

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
}

.login-story {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 46px clamp(36px, 6vw, 94px);
  background: var(--green);
  color: var(--white);
}

.login-brand,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif), Georgia, serif;
  font-size: 25px;
  font-weight: 650;
}

.login-copy {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin-top: clamp(120px, 19vh, 220px);
}

.login-copy h1,
.access-card h1,
.feed-intro h1 {
  margin: 0;
  font-family: var(--font-serif), Georgia, serif;
  font-weight: 520;
  line-height: 1.04;
}

.login-copy h1 {
  max-width: 570px;
  font-size: clamp(50px, 6.5vw, 92px);
}

.login-copy > p:last-child {
  max-width: 510px;
  margin: 32px 0 0;
  color: #cbd9d3;
  font-size: 18px;
  line-height: 1.7;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 46px;
  background: var(--paper-light);
}

.login-card {
  width: min(100%, 440px);
}

.login-card h2 {
  margin: 0 0 20px;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(39px, 4vw, 55px);
  font-weight: 520;
  line-height: 1.1;
}

.login-card .muted {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 36px;
  padding: 17px 20px;
  border-radius: 4px;
  background: var(--green);
  color: white;
  font-weight: 670;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.login-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #c9c6bd;
  border-radius: 3px;
  outline: none;
  background: white;
}

.login-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24, 60, 50, 0.1);
}

.login-form .primary-button {
  border: 0;
  cursor: pointer;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: #214e42;
}

.primary-button:focus-visible,
.nav-link:focus-visible,
.news-card a:focus-visible,
.text-link:focus-visible {
  outline: 3px solid #f19a89;
  outline-offset: 3px;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 0;
  color: #8a8d86;
  font-size: 13px;
}

.window-scene {
  position: absolute;
  right: -8vw;
  bottom: -10vw;
  width: min(48vw, 680px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 17px solid rgba(255, 255, 255, 0.075);
  border-radius: 50% 50% 4px 4px;
  background: #edb074;
  opacity: 0.92;
}

.sun {
  position: absolute;
  top: 18%;
  left: 22%;
  width: 19%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffe1af;
}

.hill {
  position: absolute;
  right: -20%;
  bottom: -28%;
  width: 90%;
  height: 76%;
  border-radius: 50% 50% 0 0;
  background: #668477;
  transform: rotate(-9deg);
}

.hill-two {
  right: 35%;
  bottom: -37%;
  background: #3e6657;
  transform: rotate(13deg);
}

.window-cross {
  position: absolute;
  z-index: 2;
  background: rgba(24, 60, 50, 0.68);
}

.window-cross.vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 15px;
}

.window-cross.horizontal {
  top: 50%;
  right: 0;
  left: 0;
  height: 15px;
}

/* Signed-in app */
.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 0 clamp(24px, 5vw, 74px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 240, 232, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  width: max-content;
  font-size: 23px;
}

.topbar nav {
  display: flex;
  align-self: stretch;
  gap: 32px;
}

.nav-link {
  position: relative;
  display: grid;
  place-items: center;
  color: #6f736c;
  font-size: 14px;
  font-weight: 610;
}

.nav-link.active,
.nav-link:hover {
  color: var(--ink);
}

.nav-link.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--coral);
  content: "";
}

.account {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  font-size: 13px;
  font-weight: 620;
}

.avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-serif), Georgia, serif;
}

.signout {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.content {
  width: min(1440px, calc(100% - clamp(40px, 8vw, 128px)));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 110px) 0 90px;
}

.memory-hero {
  position: relative;
  overflow: hidden;
  min-height: 650px;
  margin-bottom: clamp(72px, 9vw, 128px);
  background: var(--green);
  box-shadow: 0 28px 70px rgba(24, 60, 50, 0.14);
}

.memory-background {
  position: absolute;
  inset: 0;
}

.memory-background::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 37, 30, 0.86) 0%, rgba(12, 37, 30, 0.55) 46%, rgba(12, 37, 30, 0.12) 100%),
    linear-gradient(0deg, rgba(10, 29, 24, 0.5) 0%, transparent 48%);
  content: "";
}

.memory-background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
}

.memory-inner {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  align-items: center;
  gap: clamp(38px, 7vw, 110px);
  padding: clamp(44px, 6vw, 90px);
}

.memory-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  text-shadow: 0 2px 24px rgba(7, 24, 19, 0.32);
}

.memory-copy h1 {
  margin: 0;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(40px, 4.5vw, 67px);
  font-weight: 520;
  line-height: 1.06;
}

.memory-copy > p:last-child {
  margin: 26px 0 0;
  color: #ccdad4;
  font-size: 16px;
  line-height: 1.7;
}

.memory-photo {
  position: relative;
  width: min(100%, 500px);
  margin: 0;
  justify-self: end;
  padding: 10px 10px 44px;
  background: var(--white);
  box-shadow: 0 30px 70px rgba(8, 28, 22, 0.38);
  transform: rotate(1.4deg);
}

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

.memory-photo figcaption {
  position: absolute;
  right: 20px;
  bottom: 12px;
  color: var(--green);
  font-family: var(--font-serif), Georgia, serif;
  font-size: 17px;
  font-style: italic;
}

.feed-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 52px;
}

.feed-intro h1 {
  font-size: clamp(43px, 5.2vw, 76px);
}

.intro-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.source-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 8px;
}

.source-legend span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  color: #5f635d;
  font-size: 12px;
  font-weight: 700;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 22px;
}

.news-card {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.23);
  transition: transform 180ms ease;
}

.news-card:hover {
  transform: translateY(-4px);
}

.news-card a {
  display: block;
  height: 100%;
}

.news-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #d9ddd7;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.news-card:hover .news-image img {
  transform: scale(1.025);
}

.source-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 10px;
  border-radius: 2px;
  background: var(--green);
  color: white;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.03em;
}

.source-taz {
  background: #ed1c24;
}

.source-welt {
  background: #16345e;
}

.source-fr {
  background: #d22e35;
}

.source-tonline {
  background: #c52a63;
}

.source-ntv {
  background: #ed1c24;
}

.image-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: white;
  font-family: var(--font-serif), Georgia, serif;
  font-size: 40px;
}

.news-body {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 20px 18px 22px;
}

.news-body time {
  color: #797d76;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.news-body h2 {
  margin: 13px 0 14px;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 570;
  line-height: 1.25;
}

.news-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 24px;
  color: #686c65;
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.read-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  color: var(--green);
  font-size: 12px;
  font-weight: 740;
  text-transform: uppercase;
}

.lead-card {
  grid-column: span 2;
  grid-row: span 2;
}

.lead-card .news-image {
  aspect-ratio: 16 / 8.6;
}

.lead-card .news-body {
  min-height: 330px;
  padding: 25px 24px 26px;
}

.lead-card .news-body h2 {
  max-width: 820px;
  font-size: clamp(30px, 3.3vw, 48px);
  line-height: 1.14;
}

.lead-card .news-summary {
  max-width: 850px;
  font-size: 16px;
  -webkit-line-clamp: 3;
}

/* Reader */
.reader-content {
  width: min(1120px, calc(100% - clamp(40px, 8vw, 128px)));
  padding-top: clamp(40px, 6vw, 72px);
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

.reader-back:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.reader-article {
  overflow: hidden;
  background: var(--paper-light);
  box-shadow: 0 28px 90px rgba(24, 60, 50, 0.1);
}

.reader-heading {
  padding: clamp(36px, 7vw, 86px) clamp(28px, 8vw, 110px)
    clamp(34px, 6vw, 70px);
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.reader-meta time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-badge-inline {
  padding: 7px 10px;
  border-radius: 2px;
  color: white;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.03em;
}

.reader-heading h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 540;
  line-height: 1.08;
}

.reader-hero-image,
.reader-gallery figure {
  margin: 0;
}

.reader-hero-image {
  width: 100%;
  max-height: 680px;
  overflow: hidden;
  background: #d9ddd7;
}

.reader-hero-image img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: cover;
}

.reader-image-fallback {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: white;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(38px, 7vw, 80px);
}

.reader-body {
  width: min(780px, calc(100% - 56px));
  margin: 0 auto;
  padding: clamp(44px, 8vw, 90px) 0;
}

.reader-summary {
  margin: 0;
  color: #30332f;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(23px, 3vw, 33px);
  line-height: 1.55;
}

.reader-summary::first-letter {
  float: left;
  margin: 8px 9px 0 0;
  color: var(--coral);
  font-size: 3.35em;
  font-weight: 650;
  line-height: 0.74;
}

.reader-note {
  margin: 38px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.original-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 17px 20px;
  border-radius: 3px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 720;
}

.original-button:hover {
  background: #214e42;
}

.reader-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 0 2px 2px;
}

.reader-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.empty-feed,
.access-card {
  width: min(100%, 700px);
  padding: clamp(32px, 6vw, 72px);
  background: var(--paper-light);
  box-shadow: 0 24px 80px rgba(24, 60, 50, 0.08);
}

.empty-feed h2,
.access-card h1 {
  margin: 0;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 540;
}

.empty-feed p:last-child,
.access-card p {
  color: var(--muted);
  line-height: 1.7;
}

.access-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 30px;
  background: var(--green);
}

.access-card .brand-mark {
  margin-bottom: 38px;
}

.text-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(24px, 5vw, 74px);
  border-top: 1px solid var(--line);
  color: #797c75;
  font-size: 12px;
}

/* Admin */
.admin-content {
  width: min(1120px, calc(100% - clamp(40px, 8vw, 128px)));
}

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 44px;
}

.admin-heading h1 {
  margin: 0;
  font-family: var(--font-serif), Georgia, serif;
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 520;
}

.admin-heading p:last-child {
  max-width: 460px;
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.65;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
  align-items: start;
  gap: 24px;
}

.admin-card {
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--paper-light);
}

.admin-card h2 {
  margin: 0 0 24px;
  font-family: var(--font-serif), Georgia, serif;
  font-size: 28px;
  font-weight: 560;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
}

.field label {
  font-size: 12px;
  font-weight: 720;
}

.field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #c9c6bd;
  border-radius: 2px;
  outline: none;
  background: white;
}

.field input:focus,
.field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24, 60, 50, 0.1);
}

.submit-button {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  border: 0;
  border-radius: 3px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.notice {
  margin: 0 0 24px;
  padding: 13px 15px;
  border-left: 3px solid var(--coral);
  background: #fff2ed;
  font-size: 14px;
}

.user-list {
  display: grid;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.user-row:first-child {
  border-top: 0;
}

.user-meta {
  min-width: 0;
}

.user-meta strong,
.user-meta span {
  display: block;
}

.user-meta span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-pill {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.delete-button {
  border: 0;
  background: transparent;
  color: #a3493a;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story,
  .login-panel {
    min-height: auto;
  }

  .login-story {
    min-height: 56vh;
    padding-bottom: 80px;
  }

  .login-copy {
    margin-top: 90px;
  }

  .login-panel {
    min-height: 44vh;
    padding: 70px 32px;
  }

  .window-scene {
    right: -17vw;
    width: 62vw;
  }

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

  .memory-inner {
    grid-template-columns: minmax(0, 0.9fr) minmax(310px, 0.7fr);
    gap: 40px;
    padding: 50px;
  }

  .memory-photo {
    padding: 8px 8px 38px;
  }

  .lead-card {
    grid-column: span 2;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .login-story {
    padding: 30px 24px 60px;
  }

  .login-copy h1 {
    font-size: 48px;
  }

  .window-scene {
    right: -27vw;
    width: 85vw;
    opacity: 0.55;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    min-height: 70px;
    padding: 0 20px;
  }

  .topbar nav {
    order: 3;
    grid-column: 1 / -1;
    height: 48px;
    gap: 24px;
  }

  .account-name {
    display: none;
  }

  .content {
    width: calc(100% - 32px);
    padding-top: 54px;
  }

  .memory-hero {
    min-height: 0;
    margin-bottom: 72px;
  }

  .memory-background::after {
    background:
      linear-gradient(180deg, rgba(12, 37, 30, 0.72) 0%, rgba(12, 37, 30, 0.22) 48%, rgba(12, 37, 30, 0.72) 100%);
  }

  .memory-background img {
    object-position: center center;
  }

  .memory-inner {
    min-height: 780px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 42px;
    padding: 48px 26px;
  }

  .memory-copy {
    max-width: 520px;
  }

  .memory-copy h1 {
    font-size: 39px;
  }

  .memory-photo {
    width: min(92%, 480px);
    justify-self: center;
  }

  .feed-intro,
  .admin-heading {
    align-items: start;
    flex-direction: column;
  }

  .source-legend {
    justify-content: flex-start;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .lead-card {
    grid-column: span 1;
    grid-row: auto;
  }

  .lead-card .news-image {
    aspect-ratio: 16 / 10;
  }

  .lead-card .news-body h2 {
    font-size: 27px;
  }

  .news-body,
  .lead-card .news-body {
    min-height: 0;
  }

  .reader-content {
    width: calc(100% - 32px);
  }

  .reader-heading {
    padding-right: 24px;
    padding-left: 24px;
  }

  .reader-heading h1 {
    font-size: 39px;
  }

  .reader-body {
    width: calc(100% - 48px);
  }

  .reader-summary {
    font-size: 22px;
  }

  .reader-gallery {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
  }

  .admin-content {
    width: calc(100% - 32px);
  }

  .user-row {
    grid-template-columns: 1fr auto;
  }

  .delete-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
