/* Mallorca Unfolded: a travel magazine about the island beyond the obvious.
   Layout idea: photography carries each screen full-bleed; type is quiet and exact around it, with mono field notes for place data and long-form text at ~65ch. */
:root {
  --paper: #f6f5f0;
  --ink: #1d2420;
  --muted: #5d6460;
  --stone: #8b8476;
  --holm: #2e4a3a;
  --blossom: #b9706f;
  --rule: #d8d5cb;
  --card: #efede6;
  --display: "Gloock", "Bodoni 72", "Didot", Georgia, serif;
  --body: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --measure: 66ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131816; --ink: #e8e6df; --muted: #a7aba5; --stone: #9b9588;
    --holm: #93b7a0; --blossom: #e2a3a1; --rule: #2b3330; --card: #1a201d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131816; --ink: #e8e6df; --muted: #a7aba5; --stone: #9b9588;
  --holm: #93b7a0; --blossom: #e2a3a1; --rule: #2b3330; --card: #1a201d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.125rem; line-height: 1.6;
  font-optical-sizing: auto;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--blossom); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--holm); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blossom); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; text-wrap: balance; margin: 0; letter-spacing: -0.005em; }
p { margin: 0 0 1.1em; }
.mono { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead .wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding-block: 1rem; }
.brand { display: flex; align-items: baseline; gap: 0.9rem; text-decoration: none; flex-wrap: wrap; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 1.9rem; letter-spacing: 0.01em; }
.lang { display: flex; gap: 0.25rem; font-family: var(--mono); font-size: 0.75rem; }
.lang a, .lang span { padding: 0.25rem 0.5rem; border: 1px solid var(--rule); border-radius: 2px; text-decoration: none; }
.lang [aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
nav.sections { border-bottom: 1px solid var(--rule); }
nav.sections ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6rem; overflow-x: auto; scrollbar-width: none; }
nav.sections li { flex: none; }
nav.sections a { display: block; padding: 0.7rem 0; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
nav.sections a:hover, nav.sections a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--blossom); }

/* Home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; padding-block: clamp(2rem, 6vw, 4.5rem) 2rem; }
.hero h1 { font-size: clamp(3rem, 8.4vw, 7.2rem); line-height: 0.94; }
.hero h1 em { font-style: normal; color: var(--holm); }
.hero .dek { font-size: 1.25rem; max-width: 34ch; color: var(--muted); margin-top: 1.4rem; }
.wall { position: relative; aspect-ratio: 5 / 4; border-radius: 2px; overflow: hidden; background: var(--card); }
.wall canvas { width: 100%; height: 100%; }
.wall figcaption { position: absolute; left: 0.8rem; bottom: 0.7rem; background: var(--paper); padding: 0.3rem 0.55rem; }

/* Cards and grids */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-top: 1px solid var(--ink); padding-top: 0.8rem; margin: 3rem 0 1.4rem; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.features { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.6rem; }
.story { display: flex; flex-direction: column; gap: 0.7rem; text-decoration: none; }
.story .plate { aspect-ratio: 4 / 3; background: var(--card); border: 1px solid var(--rule); display: grid; place-items: end start; padding: 0.9rem; position: relative; overflow: hidden; }
.story .plate span { font-family: var(--display); font-size: clamp(3.4rem, 7vw, 5.6rem); line-height: 0.8; color: var(--holm); opacity: 0.9; }
.story .plate i { position: absolute; top: 0.8rem; right: 0.9rem; font-style: normal; }
.story h3 { font-size: 1.6rem; }
.story:first-child h3 { font-size: 2.1rem; }
.story p { color: var(--muted); font-size: 1rem; margin: 0; }
.story:hover h3 { color: var(--holm); }
.sections-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.sections-grid article { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1.3rem 1.2rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.sections-grid h3 { font-size: 1.55rem; }
.sections-grid p { font-size: 1rem; color: var(--muted); margin: 0; }
.sections-grid ul { list-style: none; padding: 0; margin: 0.3rem 0 0; font-size: 0.98rem; display: grid; gap: 0.3rem; }
.sections-grid li::before { content: "· "; color: var(--stone); }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.12rem 0.4rem; border: 1px solid var(--stone); color: var(--muted); border-radius: 2px; vertical-align: 0.15em; }
.tag.live { border-color: var(--holm); color: var(--holm); }

/* Calendar strip */
.calendar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); }
.calendar div { padding: 1rem; border-right: 1px solid var(--rule); }
.calendar div:last-child { border-right: 0; }
.calendar b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin-bottom: 0.4rem; }
.calendar p { font-size: 0.95rem; margin: 0; color: var(--muted); }

.disclosure-band { margin-top: 3rem; background: var(--ink); color: var(--paper); }
.disclosure-band .wrap { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; padding-block: 2.2rem; }
.disclosure-band h2 { font-size: 2rem; }
.disclosure-band p { max-width: 62ch; color: color-mix(in srgb, var(--paper) 82%, var(--ink)); }
.disclosure-band a { color: var(--paper); }

footer.site { border-top: 1px solid var(--rule); margin-top: 3rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.6rem 2.4rem; }
footer.site p { margin: 0; font-size: 0.95rem; color: var(--muted); max-width: 60ch; }

/* Article */
.crumbs { padding-top: 1.4rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--stone); }
.crumbs a { text-decoration: none; }
.article-head { padding-block: 1.6rem 2rem; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; align-items: end; }
.article-head h1 { font-size: clamp(2.5rem, 6vw, 4.9rem); line-height: 0.98; }
.article-head .dek { font-size: 1.3rem; color: var(--muted); margin: 1.1rem 0 0; max-width: 46ch; }
.byline { display: grid; gap: 0.3rem; border-left: 1px solid var(--rule); padding-left: 1rem; }
.article-body { display: grid; grid-template-columns: 220px minmax(0, var(--measure)) 1fr; gap: 2.4rem; padding-top: 2.2rem; }
.toc { position: sticky; top: 1rem; align-self: start; }
.toc ol { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.45rem; font-size: 0.95rem; counter-reset: t; }
.toc li { counter-increment: t; display: grid; grid-template-columns: 1.6rem 1fr; }
.toc li::before { content: counter(t, decimal-leading-zero); font-family: var(--mono); font-size: 0.7rem; color: var(--stone); padding-top: 0.25rem; }
.toc a { text-decoration: none; }
.prose h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin: 2.4rem 0 0.9rem; scroll-margin-top: 1rem; }
.prose h3 { font-size: 1.5rem; margin: 1.8rem 0 0.4rem; }
.prose .lede::first-letter { font-family: var(--display); float: left; font-size: 4.4rem; line-height: 0.82; padding: 0.35rem 0.5rem 0 0; color: var(--holm); }
.place { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1.4rem; }
.place h3 { margin-top: 0; }
.place .facts { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.2rem 0 0.7rem; }
.note { border: 1px solid var(--blossom); background: color-mix(in srgb, var(--blossom) 9%, var(--paper)); padding: 1rem 1.1rem; margin: 1.4rem 0; font-size: 1rem; }
.note strong { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; display: block; margin-bottom: 0.3rem; color: var(--blossom); font-weight: 500; }
.note p:last-child { margin: 0; }
.ourplace { border-left: 3px solid var(--blossom); padding-left: 1rem; }
.aside { align-self: start; position: sticky; top: 1rem; display: grid; gap: 1rem; }
.glance { border-top: 1px solid var(--ink); padding-top: 0.7rem; font-size: 0.95rem; }
.glance dl { margin: 0.5rem 0 0; display: grid; gap: 0.6rem; }
.glance dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.glance dd { margin: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.98rem; margin: 1rem 0 1.4rem; }
.table-scroll { overflow-x: auto; }
table.data th, table.data td { text-align: left; padding: 0.55rem 0.6rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }

.placeholder-page { padding-block: 4rem; max-width: 62ch; }
.placeholder-page h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-bottom: 1rem; }

@media (max-width: 1080px) {
  .article-body { grid-template-columns: minmax(0, 1fr); }
  .toc, .aside { position: static; }
  .toc { border-top: 1px solid var(--rule); padding-top: 0.8rem; }
  .prose { max-width: var(--measure); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .sections-grid { grid-template-columns: 1fr 1fr; }
  .calendar { grid-template-columns: 1fr 1fr; }
  .calendar div { border-bottom: 1px solid var(--rule); }
  .disclosure-band .wrap { grid-template-columns: 1fr; gap: 0.6rem; }
  .article-head { grid-template-columns: 1fr; }
  .byline { border-left: 0; border-top: 1px solid var(--rule); padding: 0.8rem 0 0; }
}
@media (max-width: 520px) {
  body { font-size: 1.0625rem; }
  .sections-grid, .calendar, .related { grid-template-columns: 1fr; }
  .brand .mono { display: none; }
  .masthead .wrap { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .story .plate span { transition: transform 600ms cubic-bezier(.2,.7,.2,1); }
  .story:hover .plate span { transform: translateY(-6px); }
}

/* Masthead, magazine version */
.masthead.mag .wrap { grid-template-columns: 1fr auto 1fr; padding-block: 1.1rem 0.9rem; }
.masthead.mag .issue { justify-self: start; }
.masthead.mag .brand { justify-self: center; flex-direction: column; align-items: center; gap: 0.15rem; text-align: center; }
.masthead.mag .brand b { font-size: clamp(1.9rem, 4.2vw, 3.1rem); letter-spacing: 0.02em; line-height: 1; }
.masthead.mag .lang { justify-self: end; }
nav.sections.center ul { justify-content: center; }

/* Cover: full-bleed photograph */
.cover { position: relative; color: #f6f3ec; background: #1d2420; }
.cover img { width: 100%; height: clamp(420px, 72vh, 760px); object-fit: cover; opacity: 0.92; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,12,0) 35%, rgba(10,14,12,0.72) 100%); pointer-events: none; }
.cover .cover-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding-bottom: clamp(1.4rem, 4vw, 3rem); }
.cover .kicker { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: #e6c5c2; }
.cover h1 { font-size: clamp(2.8rem, 7.5vw, 6.6rem); line-height: 0.95; max-width: 14ch; margin: 0.4rem 0 0.8rem; color: #f8f6f0; }
.cover p { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 46ch; margin: 0 0 1rem; color: #e9e6de; }
.cover a.read { display: inline-flex; gap: 0.5rem; align-items: center; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #f8f6f0; text-decoration: none; border-bottom: 1px solid #e6c5c2; padding-bottom: 0.2rem; }
.cover a.read:hover { color: #e6c5c2; }
.credit { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.04em; color: var(--muted); }
.cover .credit { position: absolute; right: 0.8rem; top: 0.7rem; z-index: 1; color: rgba(246,243,236,0.75); }

/* Story cards with photographs */
.story .photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--card); }
.story .photo img { width: 100%; height: 100%; object-fit: cover; }
.story:first-child .photo { aspect-ratio: 5 / 4; }
@media (prefers-reduced-motion: no-preference) {
  .story .photo img { transition: transform 900ms cubic-bezier(.2,.7,.2,1); }
  .story:hover .photo img { transform: scale(1.035); }
}

/* Photo essay strip */
.essay { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.6rem; }
.essay a { scroll-snap-align: start; text-decoration: none; display: grid; gap: 0.5rem; }
.essay .frame { aspect-ratio: 3 / 4; overflow: hidden; background: var(--card); }
.essay img { width: 100%; height: 100%; object-fit: cover; }
.essay h3 { font-size: 1.45rem; }
.essay p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* Article lead photograph */
.lead-photo { margin: 0; }
.lead-photo img { width: 100%; height: clamp(300px, 56vh, 620px); object-fit: cover; }
.lead-photo figcaption { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 0.5rem; font-size: 0.95rem; color: var(--muted); }
.inline-photo { margin: 1.6rem 0; }
.inline-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.inline-photo figcaption { padding-top: 0.4rem; font-size: 0.92rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.credits-list { font-size: 0.95rem; }
.credits-list li { margin-bottom: 0.4rem; }
@media (max-width: 860px) {
  .masthead.mag .wrap { grid-template-columns: 1fr auto; }
  .masthead.mag .issue { display: none; }
  .masthead.mag .brand { justify-self: start; align-items: flex-start; text-align: left; }
}

/* fixes */
.lead-photo.wrap { margin: 0 auto; }
.facts { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.2rem 0 0.7rem; }
@media (max-width: 860px) {
  nav.sections.center ul { justify-content: flex-start; }
  .cover .credit { top: auto; bottom: 0.4rem; right: 0.6rem; left: 0.6rem; text-align: right; }
  .cover .cover-text { padding-bottom: 2.4rem; }
}

/* Wide feature (home) */
.feature-wide { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.6rem); align-items: center; text-decoration: none; }
.feature-wide .photo { aspect-ratio: 3 / 2; overflow: hidden; background: var(--card); }
.feature-wide .photo img { width: 100%; height: 100%; object-fit: cover; }
.feature-wide h3 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); margin: 0.5rem 0 0.8rem; }
.feature-wide p { color: var(--muted); max-width: 44ch; }
.feature-wide .read-more { color: var(--ink); border-bottom: 1px solid var(--blossom); padding-bottom: 0.15rem; }
.feature-wide:hover h3 { color: var(--holm); }
@media (prefers-reduced-motion: no-preference) {
  .feature-wide .photo img { transition: transform 900ms cubic-bezier(.2,.7,.2,1); }
  .feature-wide:hover .photo img { transform: scale(1.03); }
}
@media (max-width: 860px) { .feature-wide { grid-template-columns: 1fr; } }
