/* ============================================================
   TERRA IGNOTA — guide pages, clean editorial version.
   Restyles the markup all guides share. Built for reading on a
   phone that arrived from a search: calm type, few borders,
   space reserved for ads so nothing jumps.
   ============================================================ */
:root {
    --bg: #FFFFFF;
    --sand: #F7F3EC;
    --sand-2: #EFE8DC;
    --text: #1F2328;
    --muted: #5E6672;
    --line: #E4E0D8;
    --accent: #B4472E;
    --accent-dark: #8E3420;
    --green: #2F7A55;
    --amber: #B7791F;
    --serif: 'Source Serif 4', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    margin: 0;
    padding-top: 58px;   /* room for the header bar, so it never pushes the page */
    background: var(--bg);
    color: var(--text);
    font: 400 17px/1.7 var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; }

/* ── Header bar ── */
.g-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 max(20px, calc((100vw - 1240px) / 2));
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.g-bar .brand { font: 21px/1 'Archivo Black', 'Arial Black', sans-serif; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.g-bar .brand .w1, .g-bar .brand .w2 { color: transparent; -webkit-text-stroke: 1.1px #0F5257; text-shadow: 2px 2px 0 #F2C14E; }
.g-bar .brand .w2 { -webkit-text-stroke-color: #E2553A; }
.g-bar .brand svg { width: .74em; height: .74em; vertical-align: -.01em; margin: 0 .02em; overflow: visible; }
.g-bar .brand .spin { transform-origin: 0 0; transition: transform 1.2s cubic-bezier(.3, .1, .2, 1); }
.g-bar .brand:hover .spin { transform: rotate(360deg); }
.g-bar nav { display: flex; gap: 22px; margin-left: auto; }
.g-bar nav a { font: 500 14px var(--sans); color: var(--muted); text-decoration: none; }
.g-bar nav a:hover { color: var(--accent); }
.g-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); }

/* ── Hero: title first, then the photograph ── */
.hero {
    max-width: 1240px;
    margin: 0 auto;
    padding: 34px 20px 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 26px;
}
.hero > img {
    width: 100%;
    aspect-ratio: 21 / 9;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
}
.hero-overlay { position: static; background: none; padding: 0; max-width: 860px; }
.hero h1 {
    margin: 0;
    font: 650 clamp(34px, 5vw, 56px)/1.08 var(--serif);
    letter-spacing: -.01em;
    color: var(--text);
    text-shadow: none;
    text-transform: none;
}
.hero h1 .tail { display: block; margin-top: 8px; font: 500 15px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero-sub { margin-top: 14px; font: 400 20px/1.5 var(--serif); color: var(--muted); text-shadow: none; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 18px; font: 500 14px var(--sans); color: var(--muted); }
.byline .who { color: var(--text); font-weight: 600; }
.byline span + span::before { content: "·"; margin-right: 16px; color: var(--line); }

/* ── Three columns: contents · article · facts ── */
.article-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 20px 40px;
    display: grid;
    grid-template-columns: 210px minmax(0, 700px) 290px;
    column-gap: 44px;
    justify-content: center;
    align-items: start;
    background: none;
    box-shadow: none;
}
.article-container > * { grid-column: 2; min-width: 0; }
.g-toc, .g-aside { grid-row: 1 / span 400; position: sticky; top: 80px; }
.g-toc { grid-column: 1; }
.g-aside { grid-column: 3; }

/* breadcrumb (the first div of every guide, with inline styles) */
.article-container > div:first-child[style] {
    font: 500 13px var(--sans) !important;
    color: var(--muted) !important;
    margin-bottom: 8px !important;
}
.article-container > div:first-child a { color: var(--muted); text-decoration: none; }
.article-container > div:first-child a:hover { color: var(--accent); }

.article-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 22px; padding: 0; background: none; border: 0; }
.meta-item { font: 500 14px var(--sans); color: var(--muted); }
.meta-icon { margin-right: 4px; }

/* ── Text ── */
.article-container p { margin: 0 0 1.1em; }
.article-container h2 {
    margin: 52px 0 14px;
    font: 650 30px/1.2 var(--serif);
    letter-spacing: -.005em;
}
.article-container h3 { margin: 34px 0 10px; font: 650 22px/1.3 var(--serif); }
.article-container strong { font-weight: 600; }
.article-container a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-container a:hover { color: var(--accent-dark); }

/* ── The short answer ── */
.quick-answer {
    margin: 0 0 8px;
    padding: 20px 24px 10px;
    background: var(--sand);
    border: 0;
    border-radius: var(--radius);
}
.quick-answer::before { content: "The short answer"; display: block; font: 700 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.quick-answer ul { margin: 0; padding: 0; list-style: none; }
.quick-answer li { position: relative; padding-left: 22px; margin-bottom: 10px; font-size: 16px; line-height: 1.55; }
.quick-answer li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ── Ads: space held so the text never jumps ── */
.ad-slot-wrap { margin: 30px 0; min-height: 280px; padding: 0; border: 0; background: none; }
.ad-slot-wrap::before { content: "Advertisement"; display: block; margin-bottom: 6px; font: 500 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #9AA1AB; text-align: center; }
.ad-slot-wrap ins.adsbygoogle { max-width: 100% !important; }

/* ── Map ── */
#map {
    width: 100%;
    height: 520px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--sand) center / 28px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B4472E' stroke-width='1.6'%3E%3Cpath d='M12 21s-7-6.2-7-11a7 7 0 0 1 14 0c0 4.8-7 11-7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.6'/%3E%3C/svg%3E");
    overflow: hidden;
}
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 0; padding: 0; background: none; border: 0; font: 500 13px var(--sans); color: var(--muted); }
.map-legend .legend-dot { display: none; }
.g-pin {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
    background: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    cursor: pointer;
    border: 2px solid #fff;
}
.g-pin span { transform: rotate(45deg); font: 700 11px/1 var(--sans); color: #fff; }
.g-pin.todo { background: #fff; border-color: var(--accent); }
.g-pin.todo span { color: var(--accent); }
.g-pin.extra { background: var(--green); }
.g-pin.other { background: #4B5563; }
.g-key { display: inline-flex; align-items: center; gap: 8px; }
.g-key .g-pin { width: 16px; height: 16px; cursor: default; border-width: 1.5px; }
.maplibregl-popup-content { border-radius: 8px !important; font: 14px/1.4 var(--sans); padding: 10px 14px !important; }
.maplibregl-popup-content small { display: block; color: var(--muted); margin-top: 2px; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ── Route stepper ── */
.route-strip { margin: 24px 0 4px; padding: 18px 20px 20px; background: var(--sand); border-radius: var(--radius); overflow-x: auto; }
.route-strip h4 { margin: 0 0 16px; font: 700 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.route-strip ol { list-style: none; margin: 0; padding: 0; display: flex; }
.route-strip li { position: relative; flex: 1 0 110px; padding: 30px 12px 0 0; font: 600 14px/1.3 var(--sans); }
.route-strip li::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 2px; background: var(--accent); }
.route-strip li:last-child::before { right: 100%; }
.route-strip li i { position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--sand); box-shadow: 0 0 0 1px var(--accent); }
.route-strip li.extra i { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.route-strip li em { display: block; margin-top: 4px; font: 400 12.5px/1.35 var(--sans); font-style: normal; color: var(--muted); }

/* ── UNESCO card ── */
.site-card { margin: 18px 0; padding: 20px 22px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: none; }
.site-card h3 { margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: 650 21px/1.3 var(--serif); }
.whs-badge { font: 600 12px var(--sans); text-decoration: none !important; padding: 3px 9px; border-radius: 99px; background: #E8F1FB; color: #1D5FA8 !important; }
.whs-badge:hover { background: #D5E6F8; }
.site-year { margin-left: auto; font: 500 13px var(--sans); color: var(--muted); }

/* ── Photographs ── */
.photo-block { margin: 22px 0 28px; text-align: left; }
.photo-block img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    cursor: zoom-in;
}
.photo-block img.narrow-portrait, .photo-block img.medium-portrait { width: auto; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.photo-block > br, .photo-block > p:empty { display: none; }
.photo-block > div + div { margin-top: 22px; }
.photo-caption { margin-top: 8px; font: 400 14px/1.45 var(--sans); color: var(--muted); text-align: center; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 28px; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; border-radius: var(--radius); cursor: zoom-in; }

/* ── Tables ── */
.transport-table { width: 100%; border-collapse: collapse; margin: 16px 0 26px; font-size: 15px; line-height: 1.45; border: 0; background: none; }
.transport-table th { text-align: left; font: 600 12.5px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--text); background: none; }
.transport-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; background: none; }
.transport-table tbody tr:hover td { background: var(--sand); }
.transport-table td:first-child { font-weight: 600; }

/* ── Callouts ── */
.tip-box, .risk-box { margin: 26px 0; padding: 18px 22px 8px; border-radius: var(--radius); border: 0; }
.tip-box { background: #EEF6F0; }
.risk-box { background: #FDF4E7; }
.tip-box::before, .risk-box::before { display: block; margin-bottom: 8px; font: 700 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.tip-box::before { content: "Good to know"; color: var(--green); }
.risk-box::before { content: "Watch out"; color: var(--amber); }
.tip-box h3, .risk-box h3 { margin: 0 0 8px; font: 650 19px/1.3 var(--serif); }
.tip-box ul, .risk-box ul { margin: 0 0 10px; padding-left: 20px; }
.tip-box li, .risk-box li { margin-bottom: 8px; font-size: 16px; line-height: 1.55; }

/* ── Steps, costs ── */
.step { position: relative; padding-left: 52px; margin: 22px 0; }
.step-num { position: absolute; left: 0; top: 2px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font: 700 15px var(--sans); }
.step h4 { margin: 4px 0 6px; font: 650 19px/1.3 var(--serif); }
.cost-breakdown { margin: 24px 0; padding: 18px 22px; background: var(--sand); border-radius: var(--radius); border: 0; }
.cost-breakdown h3 { margin: 0 0 10px; font: 650 18px var(--serif); }
.cost-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--sand-2); font-size: 15px; }
.cost-row span:last-child { white-space: nowrap; font-weight: 600; }
.cost-total { font-weight: 700; border-bottom: 0; }

/* ── FAQ ── */
.faq-item { border: 0; border-bottom: 1px solid var(--line); margin: 0; background: none; border-radius: 0; }
.faq-q { width: 100%; text-align: left; padding: 16px 36px 16px 0; background: none; border: 0; font: 600 17px/1.4 var(--sans); color: var(--text); cursor: pointer; position: relative; }
.faq-q::after { content: ""; position: absolute; right: 6px; top: 22px; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.faq-q.open::after { transform: rotate(-135deg); top: 26px; }
.faq-a { display: none; padding: 0 0 14px; color: #3A414B; }
.faq-a.show { display: block; }

/* ── Related ── */
.related-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 24px; }
.related-links a { font: 500 14px var(--sans); text-decoration: none; padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); background: #fff; }
.related-links a:hover { border-color: var(--accent); color: var(--accent); }

/* nearby guides, made by guide.js */
.g-near { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 14px 0 26px; }
.g-near a { text-decoration: none; color: var(--text); }
.g-near img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.g-near b { display: block; margin-top: 8px; font: 650 17px/1.3 var(--serif); }
.g-near span { font: 500 13px var(--sans); color: var(--muted); }
.g-near a:hover b { color: var(--accent); }
.g-pn { display: flex; justify-content: space-between; gap: 16px; margin: 6px 0 22px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 500 14px var(--sans); }
.g-pn a { color: var(--text); text-decoration: none; }
.g-pn a small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.g-pn a:last-child { text-align: right; }
.g-pn a:hover { color: var(--accent); }

.article-footer { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font: 400 14px/1.6 var(--sans); color: var(--muted); background: none; }
.article-footer a { color: var(--muted); }

/* ── Contents (left) ── */
.g-toc h4, .g-facts h4 { margin: 0 0 10px; font: 700 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.g-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.g-toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; font: 500 14px/1.35 var(--sans); color: var(--muted); text-decoration: none; }
.g-toc li a:hover { color: var(--text); }
.g-toc li a.on { color: var(--accent); border-left-color: var(--accent); }
.g-toc summary { display: none; }

/* ── Facts card (right) ── */
.g-facts { padding: 18px 20px 10px; background: var(--sand); border-radius: var(--radius); }
.g-facts dl { margin: 0; }
.g-facts dt { font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.g-facts dd { margin: 2px 0 12px; font: 500 15px/1.45 var(--sans); }
.g-facts dd a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--sand-2); }
.g-facts dd a:hover { color: var(--accent); }
.g-facts dd small { color: var(--muted); }
.g-side-ad { margin-top: 20px; min-height: 600px; }
.g-side-ad::before { content: "Advertisement"; display: block; margin-bottom: 6px; font: 500 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #9AA1AB; text-align: center; }

/* ── Lightbox ── */
#lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(15, 17, 20, .92); cursor: zoom-out; }
#lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 6px; }

/* ── Tablet: contents above, facts beside ── */
@media (max-width: 1180px) {
    .article-container { grid-template-columns: minmax(0, 700px) 270px; column-gap: 36px; }
    .article-container > * { grid-column: 1; }
    .g-aside { grid-column: 2; }
    .g-toc { grid-column: 1; grid-row: auto; position: static; }
    .g-toc ol { columns: 2; border-left: 0; }
    .g-toc li a { border-left: 0; padding-left: 0; }
    .g-toc { margin: 4px 0 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
}

/* ── Phone: one column ── */
@media (max-width: 860px) {
    body { font-size: 17px; padding-top: 52px; }
    .g-bar { height: 52px; gap: 14px; }
    .g-bar .brand { font-size: 18px; }
    .g-bar nav { gap: 14px; }
    .g-bar nav a { font-size: 13px; }
    .g-bar nav .wide { display: none; }
    .hero { padding: 20px 16px 0; gap: 18px; }
    .hero > img { aspect-ratio: 4 / 3; border-radius: 8px; }
    .hero-sub { font-size: 18px; }
    .byline { gap: 4px 14px; }
    .byline span + span::before { display: none; }
    .article-container { display: block; padding: 18px 16px 32px; }
    .g-aside { position: static; margin: 18px 0; }
    .g-side-ad { display: none; }
    .g-toc details summary { display: block; cursor: pointer; font: 600 15px var(--sans); }
    .g-toc h4 { display: none; }
    .g-toc ol { columns: 1; margin-top: 8px; }
    .article-container h2 { font-size: 26px; margin-top: 42px; }
    #map { height: 64vh; }
    .transport-table { display: block; overflow-x: auto; font-size: 14.5px; }
    .transport-table th, .transport-table td { min-width: 120px; }
    .g-near { grid-template-columns: 1fr 1fr; }
    .g-near a:nth-child(3) { display: none; }
    .site-year { margin-left: 0; }
}
