:root {
  --ink: #102544;
  --muted: #637083;
  --paper: #fffdf9;
  --sand: #f8eddd;
  --line: #ead8c4;
  --coral: #f45f4b;
  --coral-dark: #cb4535;
  --sun: #f5a313;
  --sea: #dff2f6;
  --teal: #1b8793;
  --green: #4d8b51;
  --shadow: 0 18px 45px rgba(40, 54, 72, .10);
  --radius: 24px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.62; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: rgba(244, 95, 75, .45); text-underline-offset: 3px; }
a:hover { color: var(--coral-dark); }
button, input { font: inherit; }
.shell { width: min(1460px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; color: #fff; background: var(--ink); border-radius: 10px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 253, 249, .94); border-bottom: 1px solid rgba(234, 216, 196, .72); backdrop-filter: blur(14px); }
.header-row { min-height: 86px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; color: var(--sun); font-size: 36px; border: 2px solid currentColor; border-radius: 50%; box-shadow: inset 0 0 0 6px var(--paper); }
.brand-copy strong { display: block; color: #d64b39; font: 700 31px/1 var(--serif); white-space: nowrap; }
.brand-copy small { display: block; margin-top: 4px; color: #3f4248; font-size: 14px; }
.main-nav { justify-self: center; display: flex; gap: clamp(18px, 2.6vw, 44px); align-items: center; }
.main-nav a { font-weight: 600; text-decoration: none; }
.main-nav a:hover { color: var(--coral); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.archive-count { display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px; border: 1px solid #ecc9a8; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.icon-button, .menu-button { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: var(--coral); cursor: pointer; }
.menu-button { display: none; color: var(--ink); background: var(--sand); }

.hero { margin-top: 14px; min-height: 470px; position: relative; overflow: hidden; border: 1px solid rgba(205, 170, 132, .42); border-radius: 30px; background: #e5f3f7 url('/assets/spain-watercolor-map-v1.webp') center/cover no-repeat; box-shadow: 0 12px 34px rgba(52, 73, 94, .07), inset 0 0 0 1px rgba(255,255,255,.38); }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(248,242,231,.96) 0%, rgba(250,246,238,.86) 27%, rgba(255,255,255,.16) 51%, rgba(255,255,255,0) 100%); }
.hero-copy { position: relative; z-index: 2; width: min(560px, 46%); padding: 48px 0 38px 72px; }
.eyebrow { margin: 0 0 7px; color: var(--coral-dark); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 530px; margin: 0; font: 700 clamp(44px, 5vw, 76px)/.98 var(--serif); letter-spacing: -.035em; }
.hero-lead { max-width: 430px; margin: 25px 0; font-size: 17px; color: #344961; }
.hero-search { max-width: 420px; padding: 13px; display: grid; grid-template-columns: 1fr auto; gap: 10px; background: rgba(255,255,255,.96); border-radius: 18px; box-shadow: var(--shadow); }
.hero-search span { align-self: center; padding-left: 10px; color: var(--muted); }
.hero-search button { padding: 12px 18px; color: #fff; border: 0; border-radius: 12px; background: var(--coral); cursor: pointer; }
.map-pin { position: absolute; z-index: 3; display: grid; place-items: center; width: 17px; height: 17px; color: #fff; background: var(--coral); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 4px 12px rgba(18,37,68,.25); }
.map-pin::after { content: attr(data-label); position: absolute; top: 20px; padding: 4px 8px; color: var(--ink); background: rgba(255,255,255,.86); border-radius: 8px; font: italic 14px var(--serif); white-space: nowrap; }
.pin-madrid { left: 67%; top: 46%; }.pin-barcelona { left: 82%; top: 31%; }.pin-valencia { left: 77%; top: 57%; }.pin-andalusia { left: 66%; top: 72%; }

.home-section { padding: 34px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font: 700 clamp(28px, 3vw, 42px)/1.08 var(--serif); }
.section-heading p { max-width: 650px; margin: 0; color: var(--muted); }
.text-link { color: var(--coral-dark); font-weight: 700; white-space: nowrap; }
.feature-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; }
.feature-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 25px rgba(18,37,68,.05); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--ink); }
.feature-card img { width: 100%; aspect-ratio: 1.55; object-fit: cover; }
.feature-card-copy { display: block; padding: 15px 21px 18px; }
.feature-card strong { display: block; font: 700 19px/1.2 var(--serif); }
.feature-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.35; }

.mood-layout { display: grid; grid-template-columns: 1fr 1fr 1fr .95fr; gap: 16px; }
.mood-card { min-height: 205px; position: relative; overflow: hidden; padding: 22px; display: flex; align-items: end; border-radius: 20px; color: #fff; background: var(--ink); text-decoration: none; }
.mood-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(9,25,43,.82), rgba(9,25,43,.05) 72%); }
.mood-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mood-card-copy { position: relative; z-index: 2; }
.mood-card strong { display: block; font: 700 24px/1.1 var(--serif); }
.mood-card small { opacity: .9; }
.season-card { padding: 21px; border-radius: 20px; background: linear-gradient(145deg, #fff4d7, #fff); border: 1px solid #efd8a7; }
.season-card h3 { margin: 0 0 12px; font: 700 24px var(--serif); }
.season-list { display: grid; gap: 8px; }
.season-list a { display: grid; grid-template-columns: 31px 1fr auto; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 12px; background: rgba(255,255,255,.72); text-decoration: none; }
.season-list span:first-child { font-size: 22px; }

.city-atlas { padding: 38px; border-radius: 28px; background: linear-gradient(135deg, #fdf1de, #f7fbf8 65%, #def2f4); border: 1px solid var(--line); }
.alphabet { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.alphabet a { min-width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; font-weight: 800; text-decoration: none; }
.city-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 24px; }
.city-preview a { padding: 6px 0; border-bottom: 1px dashed rgba(18,37,68,.2); text-decoration: none; }

.people-band { position: relative; overflow: hidden; padding: 42px; border-radius: 28px; color: #fff; background: #a83e32; }
.people-band::before { content: ''; position: absolute; inset: 0; opacity: .16; background: radial-gradient(circle at 10% 30%, #ffd992 0 2px, transparent 3px), radial-gradient(circle at 70% 50%, #fff 0 1px, transparent 2px); background-size: 30px 30px, 22px 22px; }
.people-band .section-heading, .people-grid { position: relative; z-index: 1; }
.people-band .section-heading p { color: rgba(255,255,255,.8); }
.people-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.people-card { min-height: 134px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(255,255,255,.28); border-radius: 18px; background: rgba(255,255,255,.11); text-decoration: none; }
.people-card:hover { color: #fff; background: rgba(255,255,255,.2); }
.people-card span { font-size: 30px; }
.people-card strong { font: 700 18px/1.15 var(--serif); }

.guide-grid, .latest-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.article-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; text-decoration: none; box-shadow: 0 8px 24px rgba(18,37,68,.06); }
.article-card:hover { color: var(--ink); box-shadow: var(--shadow); }
.article-card img { width: 100%; aspect-ratio: 1.6; object-fit: cover; background: var(--sand); }
.article-card-copy { display: block; padding: 18px 22px 22px; }
.article-card small { color: var(--coral-dark); font-weight: 800; }
.article-card strong { display: block; margin-top: 7px; font: 700 20px/1.25 var(--serif); }

.trust-strip { margin-top: 20px; padding: 24px 0; background: linear-gradient(90deg, #e2f4f8, #fdf4df); border-block: 1px solid #d9e6e2; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.trust-item { display: flex; gap: 12px; align-items: center; }
.trust-item span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--teal); background: rgba(255,255,255,.8); border-radius: 50%; font-size: 21px; }

.page-hero { padding: 60px 0 30px; }
.breadcrumbs { margin-bottom: 17px; color: var(--muted); font-size: 14px; }
.breadcrumbs a { text-decoration: none; }
.page-hero h1 { max-width: 1020px; margin: 0; font: 700 clamp(38px, 5vw, 68px)/1.05 var(--serif); letter-spacing: -.025em; }
.page-lead { max-width: 850px; margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 820px) minmax(240px, 330px); justify-content: center; gap: 52px; padding-bottom: 70px; }
.page-wide-layout { max-width: 1240px; padding-bottom: 70px; }
.article-main { min-width: 0; }
.article-cover { width: 100%; max-height: 560px; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow); }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 17px 0 28px; color: var(--muted); font-size: 14px; }
.article-content { color: #26384b; font-size: 17px; }
.article-content > :first-child { margin-top: 0; }
.article-content h2, .article-content h3, .article-content h4 { color: var(--ink); font-family: var(--serif); line-height: 1.18; scroll-margin-top: 110px; }
.article-content h2 { margin: 42px 0 16px; font-size: clamp(29px, 3vw, 40px); }
.article-content h3 { margin: 32px 0 13px; font-size: 26px; }
.article-content p { margin: 0 0 20px; }
.article-content img { margin: 26px auto; border-radius: 15px; }
.article-content figure { max-width: 100%; margin: 28px 0; }
.article-content figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.article-content blockquote { margin: 28px 0; padding: 18px 24px; border-left: 4px solid var(--coral); background: #fff6ec; border-radius: 0 14px 14px 0; }
.article-content table { width: 100%; margin: 25px 0; border-collapse: collapse; display: block; overflow-x: auto; }
.article-content th, .article-content td { min-width: 130px; padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.article-content iframe { width: 100%; max-width: 100%; border: 0; border-radius: 14px; }
.article-content ul, .article-content ol { padding-left: 24px; }
.article-content a { color: #b64334; }
.side-card { position: sticky; top: 112px; padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: #fffaf1; }
.side-card h2 { margin: 0 0 12px; font: 700 25px var(--serif); }
.side-links { display: grid; gap: 12px; }
.side-links a { padding-bottom: 11px; border-bottom: 1px solid var(--line); font-weight: 650; text-decoration: none; line-height: 1.35; }

.atlas-page { padding-bottom: 70px; }
.atlas-filter { width: min(560px, 100%); margin: 0 0 30px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.city-letter { padding-top: 26px; scroll-margin-top: 100px; }
.city-letter h2 { font: 700 40px var(--serif); color: var(--coral-dark); }
.city-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px 24px; }
.city-list a { padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; background: #fff; text-decoration: none; }
.city-list a:hover { border-color: var(--line); background: #fff8ee; }
.city-future { position: relative; padding: 9px 28px 9px 12px; color: #7c8795; border: 1px dashed #e3d8ca; border-radius: 10px; background: #fbf8f3; }
.city-future::after { content: 'скоро'; position: absolute; right: 8px; top: 11px; color: #aa7b58; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.collection-page { padding-bottom: 78px; }
.collection-hero { position: relative; }
.collection-hero::after { content: ''; display: block; width: 86px; height: 4px; margin-top: 25px; border-radius: 99px; background: var(--coral); }
.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 24px; }
.collection-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(18,37,68,.07); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.collection-card:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow); }
.collection-card img, .collection-image-fallback { width: 100%; aspect-ratio: 1.48; display: block; object-fit: cover; background: linear-gradient(135deg, var(--sand), var(--sea)); }
.collection-card span:last-child { display: block; padding: 15px 18px 19px; }
.collection-card strong { display: block; font: 700 20px/1.25 var(--serif); }
.collection-portraits .collection-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.collection-portraits .collection-card img { aspect-ratio: 1.38; object-position: center 24%; }
.collection-portraits .collection-card { border-radius: 14px; box-shadow: none; }
.collection-portraits .collection-card span:last-child { padding: 13px 4px 21px; }
.collection-cuisine .collection-grid, .collection-coast .collection-grid, .collection-fiesta .collection-grid, .collection-history .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.collection-cuisine .collection-card img, .collection-coast .collection-card img, .collection-fiesta .collection-card img, .collection-history .collection-card img { aspect-ratio: 1.72; }
.collection-cuisine .collection-card { border-color: #ead0a4; background: #fffaf1; }
.collection-cuisine .collection-hero::after { background: #e09a21; }
.collection-coast .collection-card { border-color: #bfdfe5; background: #f8fdff; }
.collection-coast .collection-hero::after { background: var(--teal); }
.collection-fiesta .collection-card { border-color: #f0c3b7; background: #fff9f6; }
.collection-history .collection-card { border-color: #d8c9b3; background: #fdf9f1; }
.collection-copy { max-width: 1040px; margin: 64px auto 0; padding: 40px 44px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 10px 32px rgba(18,37,68,.05); }
.collection-copy > :first-child { margin-top: 0; }

.search-dialog { width: min(760px, calc(100% - 30px)); max-height: min(780px, calc(100vh - 40px)); padding: 0; border: 0; border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.search-dialog::backdrop { background: rgba(16,37,68,.55); backdrop-filter: blur(5px); }
.search-panel { padding: 24px; }
.search-top { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.search-top input { min-width: 0; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; }
.search-top button { width: 50px; border: 0; border-radius: 13px; cursor: pointer; }
.search-results { max-height: 60vh; overflow: auto; margin-top: 15px; display: grid; }
.search-result { padding: 13px 8px; display: grid; gap: 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.search-result span { font-weight: 800; }
.search-result small, .search-hint { color: var(--muted); }

.site-footer { padding: 46px 0 26px; color: #e9eef5; background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 36px; }
.site-footer h2, .site-footer h3 { margin-top: 0; color: #fff; font-family: var(--serif); }
.site-footer a { color: #e9eef5; }
.footer-links { display: grid; gap: 8px; }
.copyright { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); color: #aebdd0; font-size: 13px; }
.not-found { min-height: 62vh; display: grid; place-items: center; text-align: center; }
.not-found h1 { margin: 0; font: 700 110px/1 var(--serif); color: var(--coral); }
.button-link { display: inline-flex; padding: 12px 18px; color: #fff; background: var(--coral); border-radius: 12px; text-decoration: none; }

@media (max-width: 1180px) {
  .archive-count { display: none; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .mood-layout { grid-template-columns: repeat(2, 1fr); }
  .people-grid { grid-template-columns: repeat(3, 1fr); }
  .collection-portraits .collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .guide-grid, .latest-grid { grid-template-columns: repeat(3, 1fr); }
  .city-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .shell { width: min(100% - 30px, 760px); }
  .header-row { min-height: 74px; grid-template-columns: auto 1fr auto; gap: 14px; }
  .brand-mark { width: 42px; height: 42px; font-size: 28px; }
  .brand-copy strong { font-size: 24px; }
  .brand-copy small { display: none; }
  .menu-button { display: grid; }
  .main-nav { position: absolute; top: 74px; left: 15px; right: 15px; padding: 18px; display: none; align-items: stretch; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
  .main-nav[data-open='true'] { display: flex; }
  .main-nav a { padding: 10px; }
  .hero { min-height: 580px; background-position: 64% center; }
  .hero::before { background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.84) 49%, rgba(255,255,255,.15) 78%, transparent); }
  .hero-copy { width: 100%; padding: 42px 30px; }
  .hero h1 { font-size: clamp(43px, 11vw, 66px); }
  .map-pin { display: none; }
  .mood-layout { grid-template-columns: 1fr 1fr; }
  .city-preview { grid-template-columns: repeat(2, 1fr); }
  .guide-grid, .latest-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 28px; }
  .article-sidebar { order: -1; }
  .side-card { position: static; }
  .city-list { grid-template-columns: repeat(2, 1fr); }
  .collection-grid, .collection-portraits .collection-grid, .collection-cuisine .collection-grid, .collection-coast .collection-grid, .collection-fiesta .collection-grid, .collection-history .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 540px); }
  .header-actions { gap: 8px; }
  .icon-button, .menu-button { width: 41px; height: 41px; }
  .hero { margin-top: 8px; min-height: 530px; border-radius: 20px; }
  .hero-copy { padding: 32px 21px; }
  .hero-lead { font-size: 15px; }
  .hero-search { grid-template-columns: 1fr; }
  .feature-grid, .people-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card strong { font-size: 17px; }
  .mood-layout, .guide-grid, .latest-grid, .trust-grid { grid-template-columns: 1fr; }
  .city-atlas, .people-band { padding: 25px 20px; border-radius: 21px; }
  .city-preview, .city-list { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .page-hero { padding-top: 42px; }
  .page-hero h1 { font-size: 40px; overflow-wrap: anywhere; }
  .article-content { font-size: 16px; }
  .collection-copy { margin-top: 38px; padding: 26px 22px; border-radius: 18px; }
  .collection-grid, .collection-cuisine .collection-grid, .collection-coast .collection-grid, .collection-fiesta .collection-grid, .collection-history .collection-grid { grid-template-columns: 1fr; gap: 18px; }
  .collection-portraits .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .collection-portraits .collection-card strong { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr; }
}

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