/* Pine Coffeehouse: the whole stylesheet. No framework. */

/* ---------- Tokens ---------- */
:root {
  --sand: #e8dbce;      /* navbar, menu rules, footer links */
  --ink: #232323;
  --muted: #767676;     /* prices and descriptions */
  --footer-bg: #2e2e2e;

  --font-display: "Lora", serif;
  --font-menu: "Playfair Display SC", serif;
  --font-text: "Playfair Display", serif;

  /* Type scale; shrinks fluidly below 768px (320px wide -> 768px wide). */
  --fs-xl: 4.25rem;     /* hero title, section titles */
  --fs-lg: 1.8rem;      /* hero subtitle, group titles, brand name */
  --fs-nav: 1.4rem;     /* nav links */
  --fs-item: 1.5rem;    /* menu item names and prices */
  --lh-tight: 1;
  --lh-price: 1.6;

  --gutter: 15px;       /* page edge padding */
}

@media (max-width: 768px) {
  :root {
    --fs-xl: calc(2.1375rem + (4.25 - 2.1375) * ((100vw - 20rem) / 28));
    --fs-lg: calc(1.28rem + (1.8 - 1.28) * ((100vw - 20rem) / 28));
    --fs-nav: calc(1.14rem + (1.4 - 1.14) * ((100vw - 20rem) / 28));
    --fs-item: calc(1.175rem + (1.5 - 1.175) * ((100vw - 20rem) / 28));
    --lh-tight: 1.4;
    --lh-price: 1.4;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;   /* keep anchors clear of the fixed navbar */
}

body {
  min-height: 100vh;
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.5 var(--font-text);
}

h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 77px;
  padding: .5rem 0;
  background: var(--sand);
  transition: min-height .2s;
}
.navbar.is-short { min-height: 60px; }

.brand {
  display: flex;
  align-items: center;
  min-height: 3.8rem;
  margin-left: 5rem;
  color: #000;
}
.brand-logo {
  width: auto;
  height: 3.8rem;
  margin-right: .8rem;
  transition: height .25s;
}
.brand-name {
  margin: .3rem 0;
  padding-right: 2rem;
  font: 400 var(--fs-lg)/1 var(--font-display);
}
.is-short .brand { min-height: 3rem; }
.is-short .brand-logo { height: 3rem; margin-right: .5rem; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  padding-right: 5rem;
}
.nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 .65rem;
  padding: .7rem 0;
  color: #000;
  font: 500 var(--fs-nav)/var(--lh-tight) var(--font-display);
  transition: color .2s ease-in-out;
}
.nav-links a:hover { color: var(--muted); }

.nav-toggle {
  display: none;
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  width: 31px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.is-short .nav-toggle { top: 20px; }
.nav-toggle span {
  position: absolute;
  right: 0;
  width: 30px;
  height: 2px;
  background: var(--ink);
  transition: transform .25s, opacity .2s, top .2s;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 8px; }
.nav-toggle span:nth-child(3) { top: 16px; }
.is-open .nav-toggle span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.is-open .nav-toggle span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* Below 1024px the links fold into a dropdown panel. */
@media (max-width: 1023px) {
  .navbar { flex-direction: column; align-items: stretch; }
  .brand { align-self: flex-start; margin: 0 1rem; }
  .brand-logo { height: 3.8rem; }
  .nav-toggle { display: block; }

  .nav-links { display: none; padding-right: 0; text-align: center; }
  .is-open .nav-links { display: block; max-height: 80vh; overflow: auto; }
  .nav-links li:last-child { margin-bottom: 1rem; }

  .is-open::after {          /* dim the page behind the open menu */
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, .1);
    pointer-events: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 3rem 0;
  overflow: hidden;
  background: #eee;
  color: #fff;
}
/* Photo layer; site.js slides it down at half scroll speed (parallax). */
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../images/pine-branches.webp") 50% 50% / cover no-repeat;
  will-change: transform;
}
.hero-bg::after {            /* green tint over the photo */
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(42, 65, 4);
  opacity: .2;
}

.hero-text { margin-left: auto; margin-right: auto; text-align: right; }
@media (min-width: 768px) {
  /* 10 of 12 columns, measured against the full row (content + gutters) */
  .hero-text { width: calc((100% + 2 * var(--gutter)) * .83333); padding: 0 var(--gutter); }
}
.hero h1 {
  margin-bottom: .5rem;
  padding-bottom: 1rem;
  font: 700 var(--fs-xl)/1.2 var(--font-display);
  word-break: break-word;
}
.hero-sub {
  margin-bottom: .5rem;
  padding-bottom: 1rem;
  font: 300 var(--fs-lg)/1.3 var(--font-display);
}
@media (max-width: 768px) {
  .hero h1, .hero-sub { line-height: 1.4; }
}

/* ---------- Menu ---------- */
.menu-section { padding: 90px 0 30px; }
#drink { padding-bottom: 45px; }   /* three groups: last one needs a little more air */

.section-title {
  font: 300 var(--fs-xl)/var(--lh-tight) var(--font-display);
  text-align: center;
}

.menu-group + .menu-group { margin-top: 45px; }
.group-title {
  margin-bottom: 3rem;
  padding-top: 1rem;
  font: 300 var(--fs-lg)/1.3 var(--font-display);
}
@media (max-width: 768px) {
  .group-title { line-height: 1.4; }
}

.items {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0 calc(var(--gutter) * -1);
}
@media (min-width: 768px) {
  .items { grid-template-columns: 1fr 1fr; }
}

.item {
  margin: 0 1rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--sand);
}
.item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;       /* the same gap under every item name */
}
.item-name {
  width: 80%;
  font: 500 var(--fs-item)/var(--lh-tight) var(--font-menu);
}
.item-price {
  color: var(--muted);
  font: 400 var(--fs-item)/var(--lh-price) var(--font-menu);
}
.item-note {
  width: 70%;
  color: var(--muted);
  line-height: 1.6;
}
@media (max-width: 767px) {
  .item-note { width: 100%; margin-top: 1rem; text-align: center; }
}

/* Fade-in on scroll (only when the script is running and motion is OK). */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal-ready [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.footer {
  padding: 30px 0;
  background: var(--footer-bg);
  color: #fff;
  text-align: center;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.foot-links li { padding: 0 1rem 1rem; }
.footer a { color: var(--sand); }

.credits { word-break: break-word; line-height: 1.6; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 90px;
  bottom: 25px;
  z-index: 5000;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s, background-color .3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: rgba(0, 0, 0, .4); }
.to-top::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: translate(-50%, -25%) rotate(45deg);
}
@media (max-width: 500px) {
  .to-top { right: auto; left: 50%; margin-left: -30px; }
}

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