/*
 * Weinhaus Kießling – Stylesheet
 * Mobile first: columns switch to the desktop layout at 800px,
 * the split main menu around the logo appears at 1080px.
 * Colors, typography and desktop spacing were measured on the former Avada theme.
 */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */

@font-face {
  font-family: 'Merriweather';
  src: url('../fonts/merriweather-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto Condensed';
  src: url('../fonts/roboto-condensed-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Base ---------- */

:root {
  --text: #747474;
  --heading: #333;
  --brown: #917852;
  --green: #379409;
  --nav-active: #a0ce4e;
  --olive: #899729;
  --wine: #670027;
  --rose: #b06767;
  --grey-btn: #a5a5a5;
  --grey-bg: #f2f2f2;
  --weinfest-bg: #e5eace;
  --footer-bg: #8bc34a;
  --serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --sans: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  --container: 1100px;
  --gap: 44px; /* column gap of the original layout */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-y: scroll; /* always show the scrollbar, so pages don't shift sideways */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 2;
  letter-spacing: 1px;
  color: var(--text);
  background: #fff;
}

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

picture {
  display: contents;
}

a {
  color: var(--heading);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brown);
}

/* Links inside running text get a subtle underline so they don't rely on color alone */
p a,
li a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-underline-offset: 3px;
}

strong {
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--serif);
  color: var(--heading);
  letter-spacing: 3px;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: clamp(28px, 5.2vw, 48px);
  font-weight: 400;
  line-height: 1.4;
}

h2 {
  font-size: clamp(22px, 3.4vw, 28px);
  font-weight: 300;
  line-height: 1.5;
}

h3 {
  font-size: clamp(19px, 2.6vw, 22px);
  font-weight: 300;
  line-height: 1.5;
}

h4 {
  font-size: 19px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0;
}

/* Text styled like an h3 (e.g. a higher-level heading or an announcement) */
.h3 {
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 22px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 3px;
  color: var(--heading);
}

p {
  margin: 0 0 20px;
}

.brown {
  color: var(--brown);
}

.green {
  color: var(--green);
}

.center {
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 10px;
  z-index: 100;
  padding: 8px 16px;
  background: #fff;
  color: var(--heading);
}

.skip-link:focus {
  top: 10px;
}

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

/* ---------- Header and main menu ---------- */

.site-header {
  position: relative;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1240px;
  min-height: 96px;
  margin: 0 auto;
  padding: 10px 64px;
}

.logo {
  position: relative;
  z-index: 1;
}

.logo img {
  width: 230px;
}

/* The menu button is a label for a hidden checkbox, so the menu works without JavaScript */
.menu-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.menu-button {
  position: absolute;
  top: 50%;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  cursor: pointer;
}

.menu-button .bars,
.menu-button .bars::before,
.menu-button .bars::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--heading);
  transition: transform 0.2s, background 0.2s;
}

.menu-button .bars {
  position: relative;
}

.menu-button .bars::before,
.menu-button .bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.menu-button .bars::before {
  top: -7px;
}

.menu-button .bars::after {
  top: 7px;
}

.menu-toggle:checked + .menu-button .bars {
  background: transparent;
}

.menu-toggle:checked + .menu-button .bars::before {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle:checked + .menu-button .bars::after {
  transform: translateY(-7px) rotate(-45deg);
}

.menu-toggle:focus-visible + .menu-button {
  outline: 2px solid var(--olive);
}

.main-nav {
  display: none;
}

.menu-toggle:checked ~ .main-nav {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.main-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 12px 24px;
  border-top: 1px solid #eee;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--heading);
}

.main-nav a:hover,
.main-nav a[aria-current='page'] {
  color: var(--nav-active);
}

@media (min-width: 1080px) {
  /* Desktop: the header stays at the top while scrolling, like the original site */
  html {
    scroll-padding-top: 140px; /* in-page links don't end up under the header */
  }

  .site-header {
    position: sticky;
    top: 0;
    border-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  }

  .header-inner {
    min-height: 132px;
    padding: 0 20px;
  }

  .logo img {
    width: 328px;
  }

  .menu-button {
    display: none;
  }

  .main-nav,
  .menu-toggle:checked ~ .main-nav {
    position: absolute;
    inset: 0 20px;
    display: grid;
    grid-template-columns: 1fr 390px 1fr;
    align-items: center;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .main-nav ul {
    display: flex;
    gap: 26px;
  }

  .nav-left {
    grid-column: 1;
    justify-content: flex-end;
  }

  .nav-right {
    grid-column: 3;
    justify-content: flex-start;
  }

  .main-nav a {
    position: relative;
    padding: 8px 0;
    border: 0;
    font-size: 12px;
  }

  /* Small chevron under the current page's menu item */
  .main-nav a[aria-current='page']::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -32px;
    width: 10px;
    height: 10px;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    transform: translateX(-50%) rotate(45deg);
  }
}

/* ---------- Generic building blocks ---------- */

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

.container--narrow {
  max-width: 675px;
}

/* Separator line under headings: 41px below the heading, 45px above the next element */
.sep {
  width: 205px;
  max-width: 60%;
  height: 0;
  margin: 41px auto 45px;
  border: 0;
  border-top: 1px solid var(--brown);
}

.sep--mid {
  width: 155px;
}

.sep--short {
  width: 105px;
}

.sep--light {
  width: 175px;
  border-top-color: #e0dede;
}

/* Background photos are real <img> elements so the browser can pick a size */
.has-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cols {
  display: grid;
  gap: 40px;
}

.cols figure {
  margin: 0;
}

.cols figure img {
  margin: 0 auto;
}

/* Content sections ("Unser Weingut", "Der Keller", …) */
.section {
  padding: 70px 20px;
}

.section--grey {
  background: var(--grey-bg);
}

.section .container > h2 {
  margin-top: 20px;
}

.section .container > .sep {
  width: 155px;
  margin-bottom: 66px;
}

/* Weinfest date under a section's columns */
.date-note {
  margin: 23.5px 0;
  text-align: center;
}

@media (min-width: 800px) {
  .section {
    padding: 125px 30px;
  }

  .section--tight {
    padding: 90px 30px;
  }

  .cols {
    grid-template-columns: 2fr 3fr;
    gap: var(--gap);
    align-items: start;
  }

  .cols--text-first {
    grid-template-columns: 3fr 2fr;
  }

  .cols--spaced > .text {
    margin-bottom: 20px;
  }

  .cols figure {
    margin-bottom: 20px;
  }

  .cols figure img {
    margin: 0;
  }
}

/* ---------- Page intro with background photo ---------- */

.page-intro {
  padding: 60px 20px 40px;
  text-align: center;
}

.page-intro .sep {
  margin-bottom: 45px;
}

.page-intro p {
  text-align: left;
}

.page-intro--center p {
  text-align: center;
}

@media (min-width: 800px) {
  /* Avada: 60px section padding + 50px above the heading; 30px + 40px below */
  .page-intro {
    padding: 110px 6% 70px;
  }

  .page-intro--tight {
    padding: 80px 6% 60px;
  }

  .page-intro--short {
    padding: 95px 6% 75px;
  }

  /* "VERSCHIEDENEN SORTEN" is 9px wider than the column; let it use a little of the margin */
  .h1--wide {
    margin-left: -12px;
    margin-right: -12px;
  }
}

/* ---------- "Wofür interessieren Sie sich?" jump menu ---------- */

.jump {
  text-align: center;
}

.jump-logo {
  width: 260px;
  margin: 0 auto;
}

.jump h2 {
  margin-top: 40px;
}

.jump > .sep {
  width: 155px;
}

/* Short text between the separator and the buttons (Kontakt) */
.jump-text {
  max-width: 675px;
  margin: 0 auto 45px;
}

/* Higher specificity than .buttons, which is defined further down */
.buttons.buttons--narrow {
  max-width: 675px;
}

.buttons {
  display: grid;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.btn {
  display: block;
  padding: 13px 20px;
  border: 0;
  background: var(--olive);
  color: #fff;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 17px;
  letter-spacing: 3px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s;
}

.btn:hover {
  color: #fff;
  filter: brightness(0.85);
}

.btn--wine {
  background: var(--wine);
}

.btn--rose {
  background: var(--rose);
}

.btn--grey {
  background: var(--grey-btn);
}

@media (min-width: 800px) {
  .jump {
    padding: 125px 6% 145px;
  }

  .jump--weingut {
    padding-top: 155px;
    padding-bottom: 175px;
  }

  .jump--verkauf {
    padding-bottom: 165px;
  }

  .jump-logo {
    width: 328px;
  }

  .jump h2 {
    margin-top: 82px;
  }

  .buttons {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--gap);
  }
}

/* ---------- Quote banner, price list, footer ---------- */

.quote {
  padding: 90px 20px;
  text-align: center;
}

@media (min-width: 800px) {
  .quote {
    padding: 125px 30px 145px;
  }

  .quote h2 {
    margin-top: 20px;
  }

  /* "Unsere Weine": the quote column has extra inner padding */
  .quote--inset .container {
    padding: 50px 35px;
  }
}

/* "Unsere Weine": the vineyard photo is anchored at the bottom, as in the original */
.quote--inset .bg {
  object-position: center bottom;
}

.pricelist {
  padding: 50px 20px;
  text-align: center;
}

.pricelist a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--serif);
  font-size: clamp(16px, 2.4vw, 24px);
  line-height: 1.5;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--heading);
}

.pricelist a:hover {
  color: var(--brown);
}

.pricelist svg {
  flex: none;
  width: 0.8em;
  height: 1em;
  fill: currentColor;
}

@media (min-width: 800px) {
  .pricelist {
    padding: 70px 30px;
  }

  .pricelist a {
    line-height: 38px;
  }
}

.site-footer {
  padding: 30px 20px 10px;
  background: var(--footer-bg);
  color: #fff;
  font-size: 12px;
  line-height: 34px;
  text-align: center;
}

.site-footer p {
  margin: 0 0 25px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

/* Keep address parts and links on one line when the footer wraps on phones */
.site-footer a,
.nowrap {
  white-space: nowrap;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 799px) {
  .site-footer {
    line-height: 2;
  }
}

/* ---------- Home ---------- */

.hero {
  position: relative;
  aspect-ratio: 1400 / 466;
  overflow: hidden;
  background: #c3c98a;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slow crossfade between the two photos; off when the visitor prefers reduced motion */
.hero .slide-2 {
  opacity: 0;
  animation: hero-fade 14s ease-in-out infinite;
}

@keyframes hero-fade {
  0%, 42% { opacity: 0; }
  50%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

.welcome {
  display: grid;
  gap: 40px;
  padding: 60px 20px;
}

.welcome-intro {
  text-align: center;
}

.welcome-intro img {
  width: 300px;
  margin: 0 auto 50px;
}

.welcome-intro .sep--light {
  margin: 40px auto 50px;
}

.motto {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--heading);
}

.motto span {
  display: block;
}

@media (min-width: 800px) {
  /* Avada sizes this section in percent of the page width (6% / 5%, columns 1/3 + 2/3, 3% gap) */
  .welcome {
    grid-template-columns: 1fr 2fr;
    column-gap: 3%;
    padding: calc(6% - 3.6px) calc(5% - 3px);
  }

  .welcome-intro {
    padding: 70px 8% 0;
  }

  .welcome-intro img {
    margin-bottom: 96px;
  }

  .welcome-intro .sep--light {
    margin: 43.5px auto 74.7px;
  }

  .motto {
    margin-bottom: 24.7px;
  }

  .welcome-text {
    padding: 120px 8% 3%;
  }
}

.announce {
  margin: 0;
  padding: 23.5px 20px;
  background: var(--weinfest-bg);
  text-align: center;
}

.teasers {
  display: grid;
}

.teaser {
  padding: 60px 30px 40px;
  text-align: center;
}

/* Tile photos are anchored at the top, as in the original */
.teaser .bg {
  object-position: center top;
}

.teaser .icon {
  display: block;
  width: auto;
  height: 55px;
  margin: 2px auto 0;
  fill: #474747;
}

.teaser h2 {
  margin-top: 44px;
  text-transform: uppercase;
}

.teaser h2 a {
  color: var(--heading);
  text-decoration: none;
}

/* The heading link covers the whole tile */
.teaser h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.teaser:hover h2 a {
  color: var(--brown);
}

.teaser .sep {
  margin: 41px auto 40px;
}

@media (min-width: 800px) {
  .teasers {
    grid-template-columns: repeat(3, 1fr);
  }

  .teaser {
    padding: 75px 12% 50px;
  }
}

/* ---------- Unsere Weine ---------- */

/* Each wine type sets its colors once on the <section> */
.theme-rot {
  --accent: var(--wine);
  --tint: #f0e6e9;
}

.theme-weiss {
  --accent: var(--olive);
  --tint: #f3f4ea;
}

.theme-rose {
  --accent: var(--rose);
  --tint: #f7f0f0;
}

.wine-intro {
  padding: 50px 20px;
  background: var(--tint);
}

.wine-intro .cols {
  max-width: var(--container);
  margin: 0 auto;
}

.wine-intro .text {
  text-align: center;
  color: var(--accent);
}

.wine-intro h2 {
  font-size: clamp(24px, 3vw, 29px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 4px;
  color: var(--accent);
}

.wine-intro .text p:not(.kicker) {
  padding: 16px;
}

.wine-intro .text .kicker + h2 + p {
  margin-top: 23px;
}

/* "K I E ß L I N G" – wide letter spacing instead of spaces between the letters */
.kicker {
  margin: 0;
  margin-bottom: -5px;
  padding-left: 12px; /* balances the spacing after the last letter */
  letter-spacing: 12px;
  color: var(--text);
}

@media (min-width: 800px) {
  .wine-intro {
    padding: 35px 30px;
  }

  .wine-intro .cols {
    grid-template-columns: 1fr 1fr;
  }

  .wine-intro .text {
    padding-bottom: 30px;
  }

  .wine-intro figure {
    padding: 0 20px;
  }

  /* White wine: bottles on the left, text on the right (text comes first on phones) */
  .theme-weiss .wine-intro figure {
    order: -1;
  }
}

.wine-boxes {
  display: grid;
  max-width: var(--container);
  margin: 40px auto 60px;
  background: var(--accent);
  color: #fff;
}

.wine-boxes-wrap {
  padding: 0 20px;
}

.wine-box {
  padding: 40px 30px 20px;
}

.wine-box + .wine-box {
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.wine-box h3 {
  margin: 0 0 25px;
  padding: 0 10px;
  background: #fff;
  color: var(--heading);
  font-size: 19px;
  letter-spacing: 0;
  text-align: center;
}

.wine-box h4 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  line-height: 2;
  letter-spacing: 1px;
  color: #fff;
}

.wine-box ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

@media (min-width: 800px) {
  .wine-boxes {
    grid-template-columns: repeat(3, 1fr);
    margin: 50px auto 80px;
  }

  .wine-boxes-wrap {
    padding: 0 30px;
  }

  .wine-box {
    padding: 55px 30px 50px;
  }

  .wine-box + .wine-box {
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
  }
}

/* ---------- Aktuelles ---------- */

.aktuelles-fest .text h2 {
  margin-top: 0;
}

@media (min-width: 800px) {
  .aktuelles-fest .text {
    padding-bottom: 40px;
  }

  .aktuelles-fest .text h2 {
    margin-top: 20px;
  }

  .aktuelles-fest figure img {
    width: 100%;
  }
}

/* ---------- Legal pages and 404 ---------- */

.title-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 40px 20px;
  text-align: center;
}

.title-bar h1 {
  font-size: clamp(26px, 4vw, 32px);
}

.legal {
  padding: 60px 20px;
}

/* Section headings look like the bold paragraphs of the original text */
.legal h2,
.legal h3 {
  margin: 0 0 20px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  line-height: 34px;
  letter-spacing: 1px;
  color: var(--text);
}

@media (min-width: 800px) {
  .legal {
    padding: 100px 30px;
  }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero .slide-2 {
    animation: none;
  }

  * {
    transition: none !important;
  }
}
