/* =========================================================
   Pockevltpoppetly — Italian Heritage Editorial
   Editorial aesthetic + Horizontal split cards
   ========================================================= */

:root {
  --cream: #F7EFE2;
  --cream-soft: #FBF6EC;
  --cream-dark: #EAE0C8;
  --terracotta: #C1502E;
  --terracotta-dark: #9E3F22;
  --olive: #7C8C52;
  --olive-dark: #4B5531;
  --espresso: #33221A;
  --espresso-soft: #4A362B;
  --border-color: #D9C9A8;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;

  --serif: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--espresso);
  line-height: 1.6;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--espresso);
  line-height: 1.2;
  overflow-wrap: anywhere;
  margin: 0 0 var(--space-3);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-top: var(--space-6); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--olive-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--terracotta-dark); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--terracotta-dark);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ===== Layout helpers ===== */
.section { padding: var(--space-6) 0; min-width: 0; }
.section-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  min-width: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--terracotta-dark);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--terracotta-dark); color: var(--cream-soft); }
.btn-primary:hover { background: var(--terracotta); color: var(--cream-soft); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--espresso); border-color: var(--espresso); }
.btn-secondary:hover { background: var(--espresso); color: var(--cream-soft); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--espresso-soft); border-color: var(--border-color); }
.btn-ghost:hover { background: var(--cream-dark); color: var(--espresso); }

/* ===== Header ===== */
.site-header {
  height: 60px;
  background: var(--cream-soft);
  border-bottom: 2px solid var(--border-color);
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  min-width: 0;
  flex-shrink: 1;
}
.logo-mark { flex-shrink: 0; }
.logo-text {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--espresso);
  overflow-wrap: anywhere;
}

.site-nav { display: flex; align-items: center; min-width: 0; }

.nav-menu {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.nav-menu li { min-width: 0; }
.nav-menu a {
  color: var(--espresso-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow-wrap: anywhere;
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] { color: var(--terracotta-dark); }

.header-cta {
  flex-shrink: 0;
  background: var(--terracotta-dark);
  color: var(--cream-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 4px;
  white-space: nowrap;
}
.header-cta:hover { background: var(--terracotta); color: var(--cream-soft); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--espresso);
}

@media (max-width: 768px) {
  .site-header { height: 52px; }
  .header-inner { padding: 0 var(--space-3); }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }

  .nav-menu {
    position: fixed;
    inset: 52px 0 0 0;
    top: 52px;
    left: 0; right: 0; bottom: 0;
    background: var(--cream-soft);
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-4);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    z-index: 50;
    overflow-y: auto;
  }
  .nav-menu.is-open { transform: translateX(0); }
  .nav-menu a { font-size: 1.1rem; }
}

/* ===== Hero ===== */
.hero, .page-hero {
  position: relative;
  color: var(--cream-soft);
  background-color: var(--espresso);
  background-image: linear-gradient(180deg, rgba(51,34,26,0.55), rgba(51,34,26,0.85)), var(--hero-image);
  background-size: cover;
  background-position: center;
  padding: var(--space-6) 0;
}
.hero-inner, .page-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  text-align: center;
}
.hero-inner h1, .page-hero-inner h1 { color: var(--cream-soft); }
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cream-dark);
  margin-bottom: var(--space-2);
}
.hero-lede { font-size: 1.15rem; color: var(--cream-soft); max-width: 640px; margin: 0 auto var(--space-4); }
.hero-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

.legal-hero { background-image: linear-gradient(180deg, rgba(51,34,26,0.75), rgba(51,34,26,0.9)), linear-gradient(135deg, var(--olive-dark), var(--espresso)); }

/* Vintage map decorative layer */
.vintage-map-bg { position: relative; overflow: visible; }
.vintage-map-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(247,239,226,0.05) 0, rgba(247,239,226,0.05) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(247,239,226,0.05) 0, rgba(247,239,226,0.05) 1px, transparent 1px, transparent 40px);
  pointer-events: none;
}
@media (max-width: 768px) {
  .vintage-map-bg::before { inset: 0; }
}

/* ===== Intro section ===== */
.intro-columns {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-5);
}
.intro-columns > div { min-width: 0; }
.intro-copy { column-count: 1; }
@media (min-width: 900px) {
  .intro-copy { column-count: 2; column-gap: var(--space-5); }
}
@media (max-width: 700px) {
  .intro-columns { grid-template-columns: 1fr; }
}

/* ===== Entry cards (Horizontal split) ===== */
.entries-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
  perspective: 1200px;
}

.entry-card {
  display: flex;
  flex-direction: row;
  background: var(--cream-soft);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  min-width: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 10px rgba(51,34,26,0.08);
}
.entry-card:hover {
  transform: translateY(-6px) rotateX(1.5deg);
  box-shadow: 0 18px 30px rgba(51,34,26,0.18);
}

.entry-media {
  flex: 0 0 40%;
  min-width: 0;
  display: block;
}
.entry-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 200px;
}

.entry-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.entry-content h3 { margin: 0; }
.entry-content h3 a { text-decoration: none; color: var(--espresso); }
.entry-content h3 a:hover { color: var(--terracotta-dark); }
.entry-content p { margin: 0; color: var(--espresso-soft); }

.entry-tags { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tag {
  background: var(--olive-dark);
  color: var(--cream-soft);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.entry-cta {
  margin-top: auto;
  font-weight: 700;
  color: var(--terracotta-dark);
  text-decoration: none;
  align-self: flex-start;
}
.entry-cta:hover { color: var(--terracotta); }

@media (max-width: 640px) {
  .entry-card { flex-direction: column; }
  .entry-media { flex: none; }
  .entry-media img { min-height: 180px; }
}

/* ===== Route section ===== */
.route-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-5);
  align-items: center;
}
.route-layout > * { min-width: 0; }
@media (max-width: 800px) {
  .route-layout { grid-template-columns: 1fr; }
}

.route-svg { width: 100%; height: auto; }
.route-path {
  stroke: var(--terracotta-dark);
  stroke-width: 3;
  stroke-dasharray: 8 8;
  animation: dash-move 6s linear infinite;
}
.route-point { fill: var(--olive-dark); }
.route-label { font-family: var(--serif); font-size: 13px; fill: var(--espresso); }

@keyframes dash-move {
  to { stroke-dashoffset: -160; }
}

/* ===== Article / sub-pages ===== */
.article-layout { max-width: 780px; margin: 0 auto; }
.lede-paragraph { font-size: 1.15rem; color: var(--espresso-soft); }
.check-list { padding-left: 1.2em; }
.check-list li { margin-bottom: var(--space-3); }

.table-wrap { overflow-x: auto; margin: var(--space-4) 0; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
  background: var(--cream-soft);
}
th, td {
  border: 1px solid var(--border-color);
  padding: var(--space-3);
  text-align: left;
  vertical-align: top;
}
th { background: var(--cream-dark); font-family: var(--serif); }

.next-section { border-top: 2px solid var(--border-color); }
.next-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.next-links > * { min-width: 0; }
@media (max-width: 640px) {
  .next-links { grid-template-columns: 1fr; }
}
.next-card {
  display: block;
  background: var(--cream-soft);
  border-left: 6px solid var(--terracotta-dark);
  padding: var(--space-4);
  text-decoration: none;
  color: var(--espresso);
  transition: transform 0.2s ease;
}
.next-card:hover { transform: translateX(4px); }
.next-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--olive-dark);
  margin-bottom: var(--space-2);
}
.next-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }

/* ===== Legal pages ===== */
.legal-columns { max-width: 780px; margin: 0 auto; }
.legal-section h2 { border-top: 1px solid var(--border-color); padding-top: var(--space-4); }
.legal-section h2:first-of-type { border-top: none; padding-top: 0; }

/* ===== Contact page ===== */
.contact-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-5);
}
.contact-layout > * { min-width: 0; }
@media (max-width: 800px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.field-group { margin-bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.field-group label { font-weight: 700; }
.field-group input,
.field-group select,
.field-group textarea {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--cream-soft);
  color: var(--espresso);
}
.field-group input.is-invalid,
.field-group select.is-invalid,
.field-group textarea.is-invalid {
  border-color: var(--terracotta-dark);
}
.field-error {
  color: var(--terracotta-dark);
  font-size: 0.85rem;
  margin: 0;
}
.form-success {
  margin-top: var(--space-4);
  color: var(--olive-dark);
  font-weight: 700;
}

.contact-details address { line-height: 1.7; margin-bottom: var(--space-3); font-style: normal; }

.map-block {
  margin-top: var(--space-4);
  background: var(--cream-dark);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
}
.map-caption { font-weight: 700; color: var(--espresso-soft); margin: 0; }

/* ===== Footer ===== */
.site-footer {
  background: var(--espresso);
  color: var(--cream-soft);
  padding-top: var(--space-6);
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-5);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: var(--space-5);
}
.footer-inner > * { min-width: 0; }
@media (max-width: 800px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}

.site-footer h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cream-dark);
  margin-top: 0;
}
.footer-brand .logo-text { color: var(--cream-soft); font-size: 1.15rem; }
.footer-brand p { color: var(--cream-dark); }

.footer-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-links a { color: var(--cream-dark); text-decoration: none; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--terracotta); }

.footer-contact address { font-style: normal; color: var(--cream-dark); line-height: 1.7; margin-bottom: var(--space-2); }
.footer-contact a { color: var(--cream-soft); }

.footer-bottom {
  border-top: 1px solid rgba(247,239,226,0.15);
  padding: var(--space-4);
  text-align: center;
}
.footer-bottom p { margin: 0; color: var(--cream-dark); font-size: 0.85rem; }

/* ===== Cookie banner ===== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--espresso);
  color: var(--cream-soft);
  padding: var(--space-4);
  z-index: 100;
  border-top: 3px solid var(--terracotta-dark);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cookie-banner.is-visible { opacity: 1; transform: translateY(0); }
.cookie-banner[hidden] { display: none; }

.cookie-banner-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.cookie-banner-inner p { margin: 0; flex: 1 1 280px; min-width: 0; color: var(--cream-dark); }
.cookie-banner-inner a { color: var(--cream-soft); }
.cookie-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ===== Small screens ===== */
@media (max-width: 400px) {
  .section { padding: var(--space-5) 0; }
  .section-inner { padding: 0 var(--space-3); }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  .hero-lede { font-size: 1rem; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1 1 auto; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .route-path { animation: none; }
}