/* ============================================================
   Valløby gamle Præstegaard — Stylesheet
   Palette: inspired by Thorald Læssøe's 1839 painting of
   Valløby Kirke — stormy sky, golden light, dark countryside.
   Font: IM Fell English (18th-c. typeface, authentic period feel)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&display=swap');

:root {
  /* ── Palette ── */
  --parchment:      #ece3c5;    /* aged, warm paper */
  --parchment-mid:  #e0d5b0;
  --parchment-dark: #d0c098;
  --ink:            #1a0f07;    /* deep warm ink */
  --ink-mid:        #3d2412;
  --forest:         #24361c;    /* dark Danish countryside green */
  --forest-mid:     #3a5228;
  --earth:          #6b4820;    /* earthy ochre-brown */
  --gold:           #c49030;    /* golden light from the painting */
  --gold-light:     #d8a84a;
  --muted:          #7a6040;
  --border:         #bca870;
  --rule:           #c8ad78;

  /* ── Header (dark as old beams) ── */
  --header-bg:      #1c2918;
  --header-text:    #f0e8d0;
  --header-muted:   #a89878;
  --header-border:  #c49030;

  /* ── Typography ── */
  --serif: 'IM Fell English', Georgia, 'Times New Roman', serif;
  --body:  'IM Fell English', Georgia, 'Times New Roman', serif;

  --max: 860px;
  --gap: 2rem;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
img  { display: block; max-width: 100%; height: auto; }


/* ── Base ── */
body {
  background-color: var(--parchment);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.85;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle aged-paper vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  background: radial-gradient(ellipse at 50% 0%, transparent 60%, rgba(30,15,5,0.06) 100%);
}

a { color: var(--earth); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin-bottom: 1.3em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;     /* IM Fell English italic = beautiful, period-correct */
  line-height: 1.25;
}
h2 { font-size: 2rem;    color: var(--ink);     margin-bottom: 1rem; }
h3 { font-size: 1.35rem; color: var(--ink-mid); margin-bottom: 0.75rem; }
h4 {
  font-style: normal;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* ── Drop cap ── */
.drop-cap::first-letter {
  float: left;
  font-family: var(--serif);
  font-style: italic;
  font-size: 4.2em;
  line-height: 0.72;
  padding: 0.06em 0.12em 0 0;
  color: var(--forest);
}

/* ── Header ── */
header {
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem var(--gap);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-crest {
  height: 90px;
  width: auto;
}

.brand-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--header-text);
  line-height: 1.3;
}
.brand-text span {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--header-muted);
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin-left: auto;
}

nav a {
  font-family: var(--serif);
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--header-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
nav a:hover, nav a.active {
  color: var(--header-text);
  border-color: var(--header-border);
  text-decoration: none;
}

/* ── Dropdown nav item ── */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-label {
  font-family: var(--serif);
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--header-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
}
.nav-label::after {
  content: ' ▾';
  font-size: 0.6em;
  letter-spacing: 0;
  opacity: 0.7;
  vertical-align: middle;
}
.nav-item:hover .nav-label,
.nav-item.sub-open .nav-label,
.nav-label.active {
  color: var(--header-text);
  border-color: var(--header-border);
}

.submenu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  border-top: 2px solid var(--gold);
  min-width: 190px;
  padding: 0.35rem 0;
  z-index: 300;
  list-style: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.submenu::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 12px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--gold);
}
.submenu li + li { border-top: 1px solid rgba(196,144,48,0.2); }
.submenu a {
  display: block;
  padding: 0.55rem 1.25rem;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--header-muted);
  border-bottom: none;
  transition: color 0.15s, background 0.15s;
}
.submenu a:hover,
.submenu a.active {
  color: var(--header-text);
  background: rgba(196,144,48,0.1);
  text-decoration: none;
}

.nav-item:hover .submenu,
.nav-item.sub-open .submenu {
  display: block;
}

/* Invisible bridge fills the gap so hover isn't lost moving from label to submenu */
.nav-item:hover::after,
.nav-item.sub-open::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -150px;
  right: 0;
  height: 14px;
}


/* ── Hamburger (mobile) ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--header-muted);
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--gold); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--gold); }

/* ── Hero ── */
.hero {
  position: relative;
  height: 84vh;
  min-height: 500px;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: sepia(30%) brightness(0.75) contrast(1.1);
}
.hero-veil {
  position: absolute;
  inset: 0;
  /* gradient like the sky in the 1839 painting — dark top, golden bottom-edge */
  background:
    linear-gradient(to bottom,
      rgba(15,22,10,0.35) 0%,
      rgba(15,22,10,0.10) 35%,
      rgba(20,12,5,0.55)  75%,
      rgba(20,12,5,0.80)  100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 4rem 2rem;
  text-align: center;
}
.hero-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 400;
  color: #f0e8d0;
  text-shadow: 0 2px 14px rgba(0,0,0,0.6), 0 0 40px rgba(196,144,48,0.2);
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}
.hero-rule {
  width: 80px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 0.75rem;
  opacity: 0.8;
}
.hero-sub {
  font-family: var(--body);
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #c8b88a;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* ── Shared layout ── */
main { flex: 1; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-label {
  font-family: var(--body);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* ── Ornamental divider ── */
.ornament {
  text-align: center;
  margin: 3rem 0;
  display: flex;
  align-items: center;
  gap: 0;
}
.ornament::before, .ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--rule), transparent);
}
.ornament::before { background: linear-gradient(to right, transparent, var(--rule)); }
.ornament::after  { background: linear-gradient(to left,  transparent, var(--rule)); }
.ornament span {
  padding: 0 1rem;
  color: var(--gold);
  font-size: 1.1rem;
  line-height: 1;
}

/* ── Home intro ── */
.intro {
  text-align: center;
  padding: 5.5rem 0 4rem;
}
.intro h1 {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  margin-bottom: 1.5rem;
}
.intro .lead {
  max-width: 580px;
  margin: 0 auto 1rem;
  color: var(--ink-mid);
  font-size: 1.05rem;
}

/* ── Home nav cards ── */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  background: var(--border);
  gap: 1px;
  margin-bottom: 1px;
}
.nav-card {
  background: var(--parchment);
  padding: 2.5rem 1.75rem;
  text-align: center;
  transition: background 0.25s;
  color: inherit;
  display: block;
  position: relative;
}
.nav-card::before {
  /* Small decorative cross above card title — timber/church motif */
  content: '✦';
  display: block;
  font-size: 0.65rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
  letter-spacing: 0.3em;
}
.nav-card:hover { background: var(--parchment-mid); text-decoration: none; }
.nav-card .card-label {
  font-family: var(--body);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.nav-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.nav-card p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ── Two-column layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* ── Figures / photos ── */
figure { margin: 2rem 0; }
figure img {
  border: 6px solid var(--parchment-dark);
  box-shadow:
    0 3px 0 var(--border),
    0 6px 20px rgba(0,0,0,0.18);
  width: 100%;
}
figcaption {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ── Interior page header ── */
.page-header {
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
  text-align: center;
  padding: 4.5rem 0 3.5rem;
}
.page-header h1 {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--header-text);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.page-header .sub {
  font-family: var(--body);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--header-muted);
}

/* ── Pull quote ── */
blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.5rem 1.5rem;
  color: var(--ink-mid);
  font-style: italic;
  font-size: 1.05rem;
  margin: 2rem 0;
  background: rgba(196,144,48,0.05);
}

/* ── Full-width image band ── */
.img-band {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center 40%;
  filter: sepia(20%) brightness(0.88) contrast(1.05);
  box-shadow: 0 3px 20px rgba(0,0,0,0.2);
  border: 6px solid var(--parchment-dark);
}

/* ── Portrait row ── */
.portrait-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

/* ── Family branches ── */
.branches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 2rem 0;
}
.branch {
  background: var(--parchment);
  padding: 1.25rem 1rem;
  text-align: center;
}
.branch .branch-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--forest);
  display: block;
  margin-bottom: 0.2rem;
}
.branch small { font-size: 0.73rem; color: var(--muted); }
a.branch {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background 0.15s, border-color 0.15s;
}
a.branch:hover {
  background: #e4d9b8;
  text-decoration: none;
}
a.branch:hover .branch-name { color: var(--forest); }

/* ── Booking gate ── */
.gate {
  max-width: 420px;
  margin: 7rem auto 5rem;
  text-align: center;
  padding: 0 1rem;
}
.gate h2 { margin-bottom: 0.75rem; }
.gate .gate-note { color: var(--muted); font-size: 0.92rem; margin-bottom: 2rem; }

.pass-form {
  display: flex;
  gap: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.pass-form input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-right: none;
  background: #fff;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
}
.pass-form input:focus { outline: none; border-color: var(--forest); }

.btn {
  padding: 0.7rem 1.4rem;
  background: var(--forest);
  color: var(--parchment);
  border: 1px solid var(--forest);
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover { background: var(--ink-mid); border-color: var(--ink-mid); }

.error-msg {
  color: #8b3030;
  font-size: 0.82rem;
  margin-top: 0.6rem;
  min-height: 1.2em;
  font-style: italic;
}

/* ── Booking content ── */
.booking-content { display: none; }
.booking-content.open { display: block; }

/* ── Calendar embed ── */
.cal-wrap {
  border: 1px solid var(--border);
  background: #fff;
  margin: 2rem 0;
  overflow: hidden;
}
.cal-wrap iframe { display: block; width: 100%; }
.cal-placeholder {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Info box ── */
.info-box {
  background: var(--parchment-mid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--forest-mid);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}
.info-box h4 { margin-bottom: 0.6rem; }
.info-box ul { padding-left: 1.25rem; }
.info-box li { margin-bottom: 0.4rem; font-size: 0.95rem; }

/* ── Price table ── */
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.price-table th, .price-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  text-align: left;
}
.price-table thead th {
  background: var(--parchment-dark);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  font-weight: 400;
}
.price-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.45); }

/* ── Log-out bar ── */
.logout-bar {
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-style: italic;
}
.logout-bar a { color: var(--muted); text-decoration: underline; cursor: pointer; }

/* ── Footer ── */
footer {
  border-top: 2px solid var(--header-border);
  background: var(--header-bg);
  padding: 2.5rem var(--gap);
  text-align: center;
  margin-top: auto;
}
.footer-inner { max-width: var(--max); margin: 0 auto; }
footer p {
  font-size: 0.78rem;
  color: var(--header-muted);
  margin-bottom: 0.2rem;
  line-height: 1.6;
}
footer a { color: var(--gold-light); }
footer a:hover { color: var(--header-text); }
footer .footer-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--header-text);
  margin-bottom: 0.5rem;
}
.footer-crest {
  height: 40px;
  width: auto;
  opacity: 0.5;
  filter: invert(1);
  margin: 0 auto 1rem;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .two-col      { grid-template-columns: 1fr; gap: 1.5rem; }
  .portrait-row { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .portrait-row img { max-height: 220px; object-fit: cover; }
  .nav-cards    { grid-template-columns: 1fr; }
  .branches     { grid-template-columns: repeat(3, 1fr); }
  .hero         { height: 62vh; }

  .header-inner {
    flex-wrap: wrap;
    padding: 0.8rem var(--gap);
    gap: 0;
  }
  .site-brand  { flex: 1; }
  .brand-crest { height: 56px; }
  .brand-text span { display: none; }
  .hamburger   { display: flex; align-self: center; }

  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-left: 0;
    gap: 0;
    order: 10;
    border-top: 1px solid #2d4228;
    padding: 0.5rem 0 0.25rem;
    background: var(--header-bg);
  }
  nav.open { display: flex; }
  nav a { padding: 0.65rem 0; font-size: 0.82rem; border-bottom: none; }

  /* Mobile dropdown */
  .nav-item {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .nav-label {
    padding: 0.65rem 0;
    font-size: 0.82rem;
    width: 100%;
  }
  .nav-item:hover .submenu { display: none; } /* disable hover on mobile */
  .nav-item.sub-open .submenu { display: block; }
  .submenu {
    position: static;
    transform: none;
    border: none;
    border-left: 2px solid var(--gold);
    border-top: none;
    box-shadow: none;
    padding: 0 0 0.25rem;
    min-width: unset;
    width: 100%;
    background: rgba(0,0,0,0.12);
    margin-bottom: 0.25rem;
  }
  .submenu::before { display: none; }
  .submenu a { padding: 0.5rem 0 0.5rem 1.25rem; font-size: 0.8rem; }

  .pass-form { flex-direction: column; }
  .pass-form input { border-right: 1px solid var(--border); border-bottom: none; }

  .page-header { padding: 3rem 0 2.5rem; }

  /* Brede tabeller (fx prislisten) scroller inden i sig selv i stedet for
     at skubbe hele siden i bredden, og fylder mindre på skærmen */
  .price-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.78rem;
  }
  .price-table thead, .price-table tbody { display: table; }
  .price-table tr { display: table-row; }
  .price-table th, .price-table td { min-width: 62px; padding: 0.4rem 0.5rem; white-space: nowrap; }
  .price-table th:first-child, .price-table td:first-child { min-width: 148px; white-space: normal; }
  .price-table thead th { font-size: 0.82rem; white-space: normal; }
  .price-table thead th small { font-size: 0.85em; }
}

@media (max-width: 480px) {
  .branches { grid-template-columns: 1fr 1fr; }
}
