/* =====================================================================
   PUNKY DISTRO - main stylesheet
   ---------------------------------------------------------------------
   Recreates the look of the old Weebly "Edison" theme, using the exact
   colours, fonts and sizes from that theme's compiled stylesheet.

   Sections in this file (search for the ==== headings):
     1. Colours & fonts (change these to restyle the whole site)
     2. Basic page setup
     3. Header & navigation
     4. Banners
     5. Page sections & columns
     6. Headings, paragraphs, buttons
     7. Slideshow
     8. Brand cards (Beer & Cider / Wine & Spirits pages)
     9. Contact form & map
    10. Footer
    11. Tablet & phone layouts
   ===================================================================== */


/* ==== 1. Colours & fonts ============================================ */
:root {
  --cream:      #f2eade;   /* page background */
  --text:       #3a393a;   /* normal text and headings */
  --dark:       #262626;   /* buttons, hamburger icon */
  --orange:     #e49e25;   /* menu hover / current page, About page band */
  --olive:      #535736;   /* green band on the home page */
  --form-text:  #6b6b6b;   /* text typed into form boxes */
  --error:      #f36363;   /* red "required" stars and form errors */

  --font-body:    'Source Code Pro', monospace;     /* typewriter-style text */
  --font-heading: 'Space Grotesk', sans-serif;      /* headings, menu, buttons */

  --page-width: 1100px;    /* widest the content gets on big screens */
  --smooth: 0.3s ease;     /* standard animation speed */
}


/* ==== 2. Basic page setup =========================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: var(--text); transition: color var(--smooth), opacity var(--smooth); }
a:hover { color: var(--dark); }

/* The centred column that holds everything (max 1100px wide) */
.container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 15px;
}

/* Text that only screen readers / Google see (used for page titles,
   because the big titles are part of the banner pictures) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}


/* ==== 3. Header & navigation ======================================== */
/* The header sticks to the top. It slides away when you scroll down
   and slides back when you scroll up (js/site.js adds "is-hidden"). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cream);
  padding: 19px 0;
  transition: transform var(--smooth);
}
.site-header.is-hidden { transform: translateY(-100%); }

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { display: block; padding-right: 15px; }
.logo img { max-height: 46px; width: auto; transition: opacity var(--smooth); }
.logo:hover img { opacity: 0.7; }

/* Desktop menu */
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 2;
}
.main-nav li { padding: 0 5px; }
.main-nav a {
  display: block;
  padding: 5px;
  text-decoration: none;
  color: var(--text);
}
/* Orange on hover, and orange for the page you're currently on */
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--orange); }

/* Hamburger button (only shown on tablets & phones, see section 11) */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
/* The three lines are one bar (i) plus a bar above (::before) and below (::after) */
.hamburger i,
.hamburger i::before,
.hamburger i::after {
  display: block;
  width: 20px; height: 3px;
  margin: 0 auto;
  background: var(--dark);
  transition: background-color 0.2s ease-out, transform 0.3s ease, top 0.3s ease;
}
.hamburger i { position: relative; }
.hamburger i::before, .hamburger i::after { content: ""; position: absolute; left: 0; }
.hamburger i::before { top: -7px; }
.hamburger i::after  { top: 7px; }
.hamburger:hover i, .hamburger:hover i::before, .hamburger:hover i::after { background: var(--orange); }
/* When the menu is open the lines turn into an X */
.nav-open .hamburger i { background: transparent !important; }
.nav-open .hamburger i::before { top: 0; transform: rotate(45deg); }
.nav-open .hamburger i::after  { top: 0; transform: rotate(-45deg); }


/* ==== 4. Banners ===================================================== */
/* Each page has a patterned banner picture that already contains the
   big page title (e.g. "ABOUT US"). Showing it as a normal picture
   means the whole thing, title included, shrinks neatly on phones. */
.banner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 15px;
}
.banner img { width: 100%; }


/* ==== 5. Page sections & columns ===================================== */
.section > .container { padding-top: 40px; padding-bottom: 40px; }

/* Coloured full-width bands */
.section--olive  { background: var(--olive); }
.section--orange { background: var(--orange); }

/* Columns. Each row of columns sets its own widths with --cols, e.g.
   style="--cols: 48fr 52fr" means 48% / 52%. "fr" = "share of the space". */
.cols {
  display: grid;
  grid-template-columns: var(--cols, 1fr 1fr);
  gap: 30px;
  align-items: start;
}
.cols--wide-gap  { gap: 50px; }
.cols--tight-gap { gap: 10px; }

/* Empty vertical space, same idea as Weebly's "spacer" blocks */
.spacer { display: block; }


/* ==== 6. Headings, paragraphs, buttons =============================== */
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
  line-height: 1;
}
h2 { font-size: 35px; }
.title-xl { font-size: 48px; line-height: 1.05; }   /* the big home-page headings */
.title-sm { font-size: 24px; font-weight: 700; }    /* "Contact us", "Punky Distributions" */
.title-cream { color: var(--cream); font-weight: 700; }
.text-center { text-align: center; }

/* Normal paragraphs: the first line is indented, like the original */
p {
  margin: 0 0 10px;
  line-height: 2;
  text-indent: 50px;
}
p.no-indent { text-indent: 0; }

/* Buttons. "button" = cream with dark outline, "button--dark" = filled.
   On hover the word slides left and a little arrow grows in beside it. */
.button {
  position: relative;
  display: inline-block;
  margin: 20px 0 10px;
  padding: 0.9375em 2.5625em;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--dark);
  background: var(--cream);
  box-shadow: inset 0 0 0 2px var(--dark);
  border: 0;
  cursor: pointer;
  overflow: hidden;
  transition: background-color var(--smooth), color var(--smooth);
}
.button span {
  position: relative;
  display: inline-block;
  transition: transform 0.25s ease;
}
.button span::after {                       /* the arrow */
  content: "";
  position: absolute;
  left: calc(100% + 10px);
  top: calc(50% - 5px);
  width: 22px; height: 11px;
  background: url("../images/icons/arrow-dark.svg") no-repeat center / contain;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.25s ease;
}
.button:hover { color: var(--dark); }
.button:hover span { transform: translateX(-0.625em); }
.button:hover span::after { transform: scaleX(1); }

.button--dark { background: var(--dark); color: var(--cream); box-shadow: none; }
.button--dark:hover { color: var(--cream); }
.button--dark span::after { background-image: url("../images/icons/arrow-light.svg"); }

/* Picture links (e.g. About page photos) fade slightly on hover */
.image-link img { transition: opacity var(--smooth); }
.image-link:hover img { opacity: 0.85; }


/* ==== 7. Slideshow =================================================== */
/* Photos sit side by side in a long strip; the strip slides along to
   show the next photo. js/site.js moves it every 5 seconds. */
.slideshow {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;            /* matches the photos' shape */
  background: rgba(0, 0, 0, 0.05);
}
.slideshow__track {
  display: flex;
  height: 100%;
  transition: transform 0.8s ease-in-out;
}
.slideshow__track img {
  flex: 0 0 100%;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Previous / next arrows - fade in when the mouse is over the slideshow */
.slideshow__arrow {
  position: absolute;
  top: 50%;
  width: 44px; height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: rgba(242, 234, 222, 0.85);
  color: var(--dark);
  font-size: 22px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--smooth), background-color var(--smooth);
}
.slideshow__arrow--prev { left: 15px; }
.slideshow__arrow--next { right: 15px; }
.slideshow:hover .slideshow__arrow,
.slideshow__arrow:focus-visible { opacity: 1; }
.slideshow__arrow:hover { background: var(--cream); color: var(--orange); }


/* ==== 8. Brand cards (Beer & Cider / Wine & Spirits) ================= */
/* Each brand = logo + description + WEBSITE button. Cards in the same
   row line up: logos share one height, buttons sit along the bottom. */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(var(--per-row, 3), 1fr);
  gap: 70px 30px;
}
.brand-grid + .brand-grid { margin-top: 70px; }

.brand {
  display: flex;
  flex-direction: column;
}
.brand__logo {
  height: var(--logo-height, 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}
.brand__logo img {
  max-height: 100%;
  width: auto;
  transition: transform var(--smooth), opacity var(--smooth);
}
.brand__logo:hover img { transform: scale(1.04); }
.brand .button { margin-top: auto; align-self: flex-start; }  /* button sticks to the bottom */
.brand p:last-of-type { margin-bottom: 20px; }

/* The "SPIRITS" and "CIDER & ALT. DRINKS" heading pictures */
.heading-image { margin: 0 auto 20px; }


/* ==== 9. Contact form & map ========================================== */
.form-field { margin-bottom: 5px; }

.form-label {
  display: inline-block;
  padding: 10px 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  line-height: normal;
  color: #000;
}
.required { color: var(--error); }
.required-note {
  display: block;
  padding: 10px 0;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 15px;
  line-height: normal;
  color: #000;
}

.name-row { display: grid; grid-template-columns: 160px 220px; gap: 20px; max-width: 100%; }

.form-input {
  display: block;
  width: 370px;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 13px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: normal;
  color: var(--form-text);
  background: transparent;
  border: 1px solid var(--text);
  border-radius: 0;
  transition: border-color var(--smooth), background-color var(--smooth);
}
.name-row .form-input { width: 100%; }
.form-input:hover { background: rgba(255, 255, 255, 0.35); }
.form-input:focus { outline: none; border-color: #000; background: rgba(255, 255, 255, 0.5); }
.form-input::placeholder { color: var(--form-text); opacity: 0.5; }
textarea.form-input { height: 200px; resize: vertical; }

/* Hidden "honeypot" box that only spam robots fill in */
.botcheck { display: none; }

.form-message {
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 1.5;
}
.form-message.is-error { color: var(--error); }
.form-thanks {
  padding: 30px;
  border: 2px solid var(--dark);
  font-family: var(--font-heading);
  font-size: 18px;
  line-height: 1.5;
}
.form-thanks strong { display: block; font-size: 24px; text-transform: uppercase; margin-bottom: 8px; }

.map {
  display: block;
  width: 100%;
  height: 250px;
  margin: 10px 0 30px;
  border: 0;
}

.contact-details p { text-indent: 0; margin: 0; }
.contact-details a { text-decoration: none; }
.contact-details a:hover { color: var(--orange); }


/* ==== 10. Footer ===================================================== */
.site-footer { padding: 58px 0; }
.social { display: flex; gap: 6px; }
.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 30px;
  color: var(--text);
}
.social a:hover { opacity: 0.6; }
.social svg { width: 15px; height: 15px; }


/* ==== 11. Tablet & phone layouts ===================================== */

/* Tablets and smaller (1024px and below): swap the menu for a hamburger */
@media (max-width: 1024px) {
  .site-header { padding: 0; }
  .header-inner { min-height: 50px; }
  .logo img { padding: 5px 0; }
  .hamburger { display: block; }

  /* The menu drops down below the header when the hamburger is tapped */
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity var(--smooth), transform var(--smooth), visibility var(--smooth);
  }
  .nav-open .main-nav { visibility: visible; opacity: 1; transform: none; }
  .main-nav ul { flex-direction: column; align-items: center; padding: 30px 0; }
  .main-nav a { padding: 12px 15px; color: #606060; }

  .brand-grid[style*="--per-row: 4"] { --per-row: 2 !important; }
}

/* Phones (767px and below) */
@media (max-width: 767px) {
  body { font-size: 15px; }

  /* Columns of text stack on top of each other (text gets too squashed
     otherwise). Rows marked "cols--keep" stay side by side. */
  .cols:not(.cols--keep) { grid-template-columns: 1fr; }
  .cols--keep { gap: 10px; }

  .brand-grid { grid-template-columns: 1fr; gap: 50px; --per-row: 1 !important; }
  .brand-grid + .brand-grid { margin-top: 50px; }
  .brand__logo { height: auto; max-height: 120px; margin-bottom: 15px; }
  .brand__logo img { max-height: 120px; }

  .title-xl { font-size: 36px; }
  h2 { font-size: 28px; }
  .title-sm { font-size: 18px; }

  /* Weebly's tall empty gaps are shrunk on phones */
  .spacer { height: 20px !important; }
  .spacer--desktop-only { display: none; }

  .name-row { grid-template-columns: 1fr 1fr; }
  .form-input { width: 100%; }
}

/* People who've asked their device for less motion get no sliding */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
