/* The Cloud Nine Chronicle - shared broadsheet styling */

:root {
  --ink: #111;
  --paper: #f4f1ea;
  --rule: #1a1a1a;
  --muted: #555;
  --soft: #d4cfc4;
  --accent: #8a1a1a;
  --section-travel: #8a1a1a;
  --section-photo: #1f4e79;
  --section-sailing: #245447;
  --section-explore: #6b4423;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.6;
}

a { color: inherit; }
a.headline-link { text-decoration: none; }
a.headline-link:hover { color: var(--accent); }

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

.paper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 40px 60px;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.015) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.02) 0, transparent 50%);
}

/* Masthead */
.masthead {
  text-align: center;
  border-bottom: 3px double var(--rule);
  padding-bottom: 14px;
  margin-bottom: 8px;
}
.masthead .kicker {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.masthead h1.title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 78px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -1px;
  font-variant: small-caps;
  line-height: 1;
}
.masthead h1.title a {
  text-decoration: none;
  color: inherit;
}
.masthead .latin {
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.meta-bar {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
  color: var(--muted);
}

/* Section nav */
.section-nav {
  display: flex;
  justify-content: center;
  gap: 36px;
  padding: 12px 0;
  border-bottom: 3px double var(--rule);
  margin-bottom: 30px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}
.section-nav a {
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.section-nav a.active,
.section-nav a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* Section tag (article header / cards) */
.section-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  padding: 3px 10px;
  margin-bottom: 10px;
}
.tag-travel { color: var(--section-travel); border-color: var(--section-travel); }
.tag-photo { color: var(--section-photo); border-color: var(--section-photo); }
.tag-sailing { color: var(--section-sailing); border-color: var(--section-sailing); }
.tag-explore { color: var(--section-explore); border-color: var(--section-explore); }

/* ============ FRONT PAGE GRID ============ */
.front-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 30px;
  margin-bottom: 30px;
}

/* Lead story */
.lead-story .section-tag { font-size: 11px; }
.lead-story .lead-headline {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 56px;
  line-height: 1.05;
  font-weight: 900;
  margin: 6px 0 12px;
  letter-spacing: -0.5px;
}
.lead-story .lead-deck {
  font-size: 19px;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.4;
}
.lead-story .byline {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.lead-story .byline strong { color: var(--ink); }
.lead-story img.lead-img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  filter: grayscale(0.1) contrast(1.05);
}
.lead-story .caption {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--soft);
  margin-bottom: 14px;
}
.lead-story .lead-excerpt {
  font-size: 16px;
  line-height: 1.7;
  text-align: justify;
}
.lead-story .lead-excerpt p { margin: 0 0 10px; }
.lead-story .read-more {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

/* Sidebar latest */
.latest-col {
  border-left: 1px solid var(--rule);
  padding-left: 32px;
}
.latest-col h3.col-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rule);
  letter-spacing: 1px;
  font-variant: small-caps;
}
.latest-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--soft);
}
.latest-item:last-child { border-bottom: none; }
.latest-item .section-tag {
  font-size: 9px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.latest-item h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  margin: 0 0 6px;
  line-height: 1.2;
}
.latest-item h4 a {
  text-decoration: none;
  color: var(--ink);
}
.latest-item h4 a:hover { color: var(--accent); }
.latest-item .summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

/* Below-the-fold three column */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  border-bottom: 3px double var(--rule);
  padding-bottom: 30px;
  margin-bottom: 30px;
}
.story-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: grayscale(0.1) contrast(1.05);
  margin-bottom: 10px;
}
.story-card h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  margin: 8px 0 6px;
  line-height: 1.15;
}
.story-card h4 a {
  text-decoration: none;
  color: var(--ink);
}
.story-card h4 a:hover { color: var(--accent); }
.story-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.5;
}
.story-card .byline {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Wide photo essay strip */
.photo-strip {
  margin: 30px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}
.photo-strip h3 {
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-variant: small-caps;
  letter-spacing: 3px;
  font-size: 24px;
  margin: 0 0 14px;
}
.photo-strip .strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.photo-strip .strip-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: grayscale(0.15) contrast(1.05);
  display: block;
}
.photo-strip .strip-link {
  display: block;
  cursor: zoom-in;
  overflow: hidden;
  position: relative;
}
.photo-strip .strip-link img {
  transition: transform 0.4s ease, filter 0.3s ease;
}
.photo-strip .strip-link:hover img {
  transform: scale(1.04);
  filter: grayscale(0) contrast(1.1);
}

/* Two column digest */
.digest {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  margin-bottom: 30px;
}
.digest-main h3,
.digest-side h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rule);
  font-variant: small-caps;
  letter-spacing: 1px;
}
.digest-main .digest-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--soft);
}
.digest-main .digest-row:last-child { border-bottom: none; }
.digest-main .digest-row img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  filter: grayscale(0.1) contrast(1.05);
}
.digest-main .digest-row h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  margin: 0 0 6px;
  line-height: 1.2;
}
.digest-main .digest-row h4 a { text-decoration: none; color: var(--ink); }
.digest-main .digest-row h4 a:hover { color: var(--accent); }
.digest-main .digest-row p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 6px;
}
.most-read-list { padding: 0; margin: 0; list-style: none; counter-reset: rank; }
.most-read-list li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft);
}
.most-read-list li::before {
  content: counter(rank);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.most-read-list a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.3;
}
.most-read-list a:hover { color: var(--accent); }

/* ============ ARTICLE PAGE ============ */
.article-header {
  text-align: center;
  margin-bottom: 24px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}
.headline {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 56px;
  line-height: 1.1;
  font-weight: 900;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.subhead {
  font-size: 21px;
  font-style: italic;
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto 18px;
  line-height: 1.4;
}
.byline-block {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.7;
}
.byline-block strong { color: var(--ink); }
.byline-block .byline-seg {
  display: inline-block;
  white-space: nowrap;
}
.byline-block .sep {
  color: var(--soft);
  margin: 0 6px;
  display: inline-block;
}

.lead-image {
  margin: 30px 0 10px;
}
.lead-image img {
  width: 100%;
  height: auto;
  max-height: 640px;
  object-fit: contain;
  display: block;
  background: var(--paper);
  filter: grayscale(0.05) contrast(1.05);
  cursor: zoom-in;
}
.article-body img,
.photo-grid img,
.lead-image img {
  cursor: zoom-in;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 10, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  display: block;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  filter: none;
}
.lightbox .nav,
.lightbox .close {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Playfair Display', Georgia, serif;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox .nav:hover,
.lightbox .close:hover { background: rgba(255,255,255,0.18); }
.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 32px;
  border-radius: 50%;
}
.lightbox .nav.prev { left: 24px; }
.lightbox .nav.next { right: 24px; }
.lightbox .close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 22px;
  border-radius: 50%;
}
.lightbox .counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.lightbox .caption {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  color: rgba(255,255,255,0.85);
  font-style: italic;
  font-size: 14px;
  text-align: center;
  border: none;
}

/* End-of-gallery CTA card */
.lightbox .cta {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 560px;
  padding: 48px 40px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.lightbox .cta-logo {
  width: 280px;
  height: auto;
  max-width: 80%;
  max-height: none;
  margin: 0 0 28px;
  box-shadow: none;
  filter: brightness(0) invert(1);
}
.lightbox .cta-eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
}
.lightbox .cta-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 38px;
  line-height: 1.1;
  color: #fff;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
}
.lightbox .cta-body {
  font-family: 'Georgia', serif;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.78);
  margin: 0 0 28px;
}
.lightbox .cta-button {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #111;
  background: #fff;
  padding: 14px 26px;
  text-decoration: none;
  border: 1px solid #fff;
  transition: background 0.15s ease, color 0.15s ease;
}
.lightbox .cta-button:hover {
  background: transparent;
  color: #fff;
}
.caption {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--soft);
}

.article-body {
  max-width: 980px;
  margin: 24px auto 0;
}
.body-text {
  column-count: 2;
  column-gap: 36px;
  column-rule: 1px solid var(--soft);
  text-align: justify;
  font-size: 16px;
  line-height: 1.75;
  margin-top: 24px;
}
.body-text p { margin: 0 0 14px; }
.body-text p:first-child::first-letter {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 68px;
  float: left;
  line-height: 0.9;
  padding: 4px 8px 0 0;
  font-weight: 900;
}

.photo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin: 30px 0;
}
.photo-grid .stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
}
.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.1) contrast(1.05);
}
.photo-grid .main { height: 420px; }

/* Map block */
.map-section {
  margin: 40px auto;
  max-width: 1100px;
  border-top: 3px double var(--rule);
  border-bottom: 3px double var(--rule);
  padding: 24px 0;
}
.map-title {
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  margin: 0 0 4px;
  font-variant: small-caps;
  letter-spacing: 2px;
}
.coords {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
}
#map {
  height: 420px;
  width: 100%;
  border: 1px solid var(--rule);
  filter: sepia(0.15) saturate(0.85);
}
.map-legend {
  display: flex;
  justify-content: space-around;
  margin-top: 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}

/* Related */
.related {
  margin: 50px auto 20px;
  max-width: 1100px;
}
.related h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-variant: small-caps;
  letter-spacing: 2px;
  text-align: center;
  font-size: 22px;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rule);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Footer */
.footer-rule {
  text-align: center;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============ Responsive ============ */

/* Universal safety: nothing should ever overflow its container */
img { max-width: 100%; height: auto; }
.paper, .article-body, .front-grid, .three-col, .digest, .photo-grid, .related-grid, .lead-image, .latest-col {
  min-width: 0;
}
.photo-grid, .three-col, .related-grid { overflow: hidden; }

/* iPad in any orientation, up to iPad Pro 12.9" landscape (1366px) */
@media (max-width: 1366px) {
  .paper { padding: 20px 22px 40px; }

  .masthead h1.title { font-size: 48px; line-height: 1; }
  .masthead .latin { font-size: 12px; }

  .meta-bar {
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 10px;
  }
  .section-nav {
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 0;
    font-size: 11px;
    letter-spacing: 0.2em;
  }

  /* Collapse all multi-column layouts to single column */
  .front-grid,
  .three-col,
  .digest,
  .related-grid,
  .body-text {
    grid-template-columns: 1fr !important;
    column-count: 1 !important;
  }
  .latest-col {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 16px;
    margin-top: 8px;
  }
  .photo-strip .strip-grid { grid-template-columns: repeat(2, 1fr); }

  /* Headlines */
  .lead-story .lead-headline { font-size: 36px; }
  .headline { font-size: 36px; line-height: 1.15; }
  .subhead { font-size: 18px; }

  /* Images: keep aspect ratio, cap height instead of forcing one */
  .lead-image img { height: auto; max-height: 480px; }
  .lead-story img.lead-img { height: auto; max-height: 380px; object-fit: cover; }

  /* Photo grid: main full-width on top, stack falls underneath */
  .photo-grid { grid-template-columns: 1fr; gap: 12px; }
  .photo-grid .main { height: auto; max-height: 360px; }
  .photo-grid .stack { grid-template-rows: auto auto; gap: 12px; }
  .photo-grid img { height: auto; max-height: 240px; }

  /* Digest row: stack image above text */
  .digest-main .digest-row { grid-template-columns: 1fr; gap: 8px; }
  .digest-main .digest-row img { height: auto; max-height: 220px; }

  /* Story cards (three-col + related): tighter heights */
  .story-card img { height: auto; max-height: 220px; }

  /* Lightbox tweaks */
  .lightbox .nav { width: 44px; height: 44px; font-size: 26px; }
  .lightbox .nav.prev { left: 8px; }
  .lightbox .nav.next { right: 8px; }
  .lightbox .close { top: 12px; right: 12px; }
  .lightbox .caption { bottom: 60px; max-width: 88vw; font-size: 13px; }
  .lightbox .counter { font-size: 10px; }
}

/* Phones (iPhone portrait, narrow Android) */
@media (max-width: 600px) {
  .paper { padding: 14px 14px 32px; }

  .masthead h1.title { font-size: 34px; letter-spacing: 0; }
  .masthead .kicker { font-size: 10px; letter-spacing: 0.2em; }
  .masthead .latin { font-size: 11px; }

  .meta-bar {
    justify-content: flex-start;
    font-size: 9px;
    letter-spacing: 0.1em;
    padding: 6px 0;
  }
  .meta-bar span { white-space: nowrap; }
  .section-nav {
    gap: 10px 14px;
    padding: 8px 0;
    margin-bottom: 20px;
    font-size: 10px;
    letter-spacing: 0.15em;
  }

  /* Headlines */
  .lead-story .lead-headline { font-size: 28px; line-height: 1.1; }
  .headline { font-size: 28px; }
  .subhead { font-size: 16px; }

  /* Article header allow nav links to wrap */
  .byline-block {
    font-size: 11px;
    letter-spacing: 0.12em;
    line-height: 1.8;
  }
  .byline-block .sep { display: none; }
  .byline-block .byline-seg { display: block; }

  /* Drop cap smaller on tiny screens */
  .body-text p:first-child::first-letter { font-size: 52px; }

  /* Hero / lead images: cap at viewport-friendly heights */
  .lead-image { margin: 18px 0 8px; }
  .lead-image img { max-height: 60vh; }
  .lead-story img.lead-img { max-height: 240px; }

  /* Photo grid */
  .photo-grid { gap: 10px; }
  .photo-grid .main { max-height: 260px; }
  .photo-grid img { max-height: 180px; }

  /* Latest items on homepage */
  .latest-item h4 { font-size: 18px; }
  .latest-item .summary { font-size: 13px; }
  .col-title { font-size: 18px !important; }

  /* Story cards */
  .story-card img { max-height: 180px; }
  .story-card h4 { font-size: 20px; }

  /* Photo strip: 2 wide is still fine */
  .photo-strip .strip-grid img { height: auto; max-height: 140px; }

  /* Digest */
  .digest-main .digest-row img { max-height: 180px; }
  .digest-main h4 { font-size: 19px; }
  .most-read-list li::before { font-size: 22px; }
  .most-read-list a { font-size: 14px; }

  /* Map */
  #map { height: 300px; }
  .map-section { padding: 16px 0; }
  .map-title { font-size: 20px; }
  .map-legend {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  /* Captions */
  .caption { font-size: 11px; }
  .map-section .coords { font-size: 11px; }

  /* Lightbox */
  .lightbox img { max-width: 96vw; max-height: 78vh; }
  .lightbox .nav { width: 40px; height: 40px; font-size: 22px; }
  .lightbox .close { width: 38px; height: 38px; font-size: 18px; }
  .lightbox .caption { font-size: 12px; bottom: 56px; }

  /* Lightbox CTA */
  .lightbox .cta {
    max-width: 92vw;
    padding: 28px 22px;
  }
  .lightbox .cta-logo { width: 200px; margin-bottom: 18px; }
  .lightbox .cta-headline { font-size: 26px; }
  .lightbox .cta-body { font-size: 14px; margin-bottom: 22px; }
  .lightbox .cta-button { font-size: 11px; padding: 12px 18px; letter-spacing: 0.2em; }

  /* Footer */
  .footer-rule { font-size: 10px; letter-spacing: 0.2em; }
}
