/*
 * site.css: the only stylesheet for frangosperiperi.co.uk.
 *
 * Sections, in order:
 *   1. Tokens        colours, fonts, spacing (custom properties)
 *   2. Fonts         @font-face for the self-hosted Montserrat
 *   3. Base          reset and element defaults (from the original "frango" theme)
 *   4. Layout        page wrapper, content column
 *   5. Components    one block per component: "=== Component: <name> ==="
 *   6. Pages         rare page-specific rules
 *   7. Utilities
 *
 * Breakpoints (taken from the original theme's media queries; media queries can't use
 * custom properties, so they are written out where used):
 *   mobile-small  ≤ 460px   (tiles stack in one column, smaller logo)
 *   mobile        ≤ 768px   (hamburger menu, 14px body text, two tiles per row)
 *   desktop       ≥ 769px   (horizontal red nav bar, three tiles per row)
 *
 * Editing: change tokens to restyle the site; add new components as new blocks.
 */

/* ============ 1. Tokens ============ */
:root {
  /* Colours (computed styles of the original) */
  --color-text: #000000;
  --color-heading: #181818;
  --color-bg: #fce2b9;            /* cream page background */
  --color-red: #e92435;           /* header bar */
  --color-red-alt: #e92536;       /* tiles, divider, mobile menu */
  --color-red-hover: #e22c27;     /* ORDER NOW hover fill */
  --color-orange: #e06a27;        /* mobile menu link hover */
  --color-yellow: #fac305;        /* accents, hero rule */
  --color-green: #146748;         /* footer, contact panel */
  --color-white: #ffffff;
  --color-link: #2a85e8;
  --color-link-hover: #11639d;

  /* Typography */
  --font-body: Montserrat, sans-serif;
  --text-base: 16px;              /* 14px at ≤ 768px */
  --leading: 1.5;

  /* Layout */
  --header-height: 60px;
  --content-max: 1000px;
  --gutter: 20px;

  /* Motion */
  --duration-fast: 0.2s;          /* button / tile hovers: 0.2s linear */
  --duration-menu: 400ms;         /* mobile menu slide (jQuery slideToggle default) */
  --ease-menu: ease-in-out;
  --shadow-text: 2px 2px 5px rgba(0, 0, 0, 0.6);
}

/* ============ 2. Fonts ============ */
/* Montserrat 400 (latin), the exact Google Fonts v10 file the original loaded. Only weight in use. */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-v10-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}

/* ============ 3. Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--color-heading); font-weight: 400; line-height: 1.25; margin: 0; }
h1 { font-size: 46px; margin-bottom: 12px; }
h2 { font-size: 35px; margin-bottom: 9px; }
h3 { font-size: 28px; margin-bottom: 9px; }
p { font-size: 16px; line-height: 1.5; margin: 0 0 18px; }
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--color-yellow); outline-offset: 2px; }

@media (max-width: 768px) {
  body { font-size: 14px; }
  p { font-size: 14px; }
  h1 { font-size: 32px; line-height: 1.3; }
  h2 { font-size: 28px; line-height: 1.3; }
  h3 { font-size: 21px; line-height: 1.3; }
}

/* ============ 4. Layout ============ */
/* <main> clears the fixed header (original #main-content padding 60px 20px 0). */
.site-main { padding: var(--header-height) var(--gutter) 0; position: relative; }
.page-content { position: relative; width: 100%; max-width: var(--content-max); margin: auto; }
.page-content::after { content: ""; display: table; clear: both; }

/* ============ 5. Components ============ */

/* === Component: skip-link === */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; padding: 8px 16px; background: var(--color-white); color: var(--color-text); }
.skip-link:focus { left: 16px; }

/* === Component: site-header (red fixed bar; hamburger + slide-down list at ≤ 768px) === */
.site-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; background: var(--color-red); }
.site-header__inner { position: relative; width: 100%; max-width: var(--content-max); margin: auto; }
.nav-toggle { display: none; }
.site-nav__list { list-style: none; margin: 0; padding: 0; }
.site-nav__list a { display: block; color: var(--color-white); }

@media (min-width: 769px) {
  .site-header { padding: 0 var(--gutter); }
  .site-nav__list { display: flex; text-align: left; }
  .site-nav__list li { margin-right: 24px; } /* 20px + the inline-block word gap of the original */
  .site-nav__list a { text-transform: uppercase; font-size: 13px; line-height: 20px; padding: 20px 0; }
  .site-nav__list a:hover, .site-nav__list a:focus { color: var(--color-white); }
}

@media (max-width: 768px) {
  .site-header { background: var(--color-red-alt); }
  .site-header__inner { max-width: none; }
  .nav-toggle {
    display: block; margin-left: auto; padding: 20px 20px 21px; background: none; border: 0; cursor: pointer;
    min-width: 66px; min-height: var(--header-height);
  }
  .nav-toggle__bars { display: block; width: 26px; height: 19px; }
  .nav-toggle__bars span { display: block; width: 26px; height: 3px; border-radius: 1px; background: var(--color-white); }
  .nav-toggle__bars span + span { margin-top: 5px; }
  /* Slide-down: grid row animates 0fr → 1fr; align-items: stretch keeps the list clipped while it
     animates; visibility keeps closed links out of the tab order. Without JS the list shows open. */
  .site-nav { display: grid; grid-template-rows: 1fr; align-items: stretch; }
  .js .site-nav { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--duration-menu) var(--ease-menu), visibility 0s linear var(--duration-menu); }
  .js .site-nav.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--duration-menu) var(--ease-menu), visibility 0s linear 0s; }
  .site-nav__list { overflow: hidden; min-height: 0; text-align: center; font-size: 0.875em; }
  .site-nav__list li { border-bottom: 1px solid var(--color-white); }
  .site-nav__list li:last-child { border-bottom: 0; }
  .site-nav__list a { padding: 12px; text-transform: none; }
  .site-nav__list a:hover { background: var(--color-orange); color: var(--color-white); }
}

/* === Component: logo (centred logo under the header) === */
.logo { display: block; width: 150px; margin: 40px auto; }
.logo img { width: 100%; }
/* Home: bigger and overlapping the top of the hero */
.logo--overlap { width: 200px; margin: 40px auto -100px; position: relative; z-index: 100; }
@media (max-width: 768px) { .logo--overlap { width: 160px; margin: 30px auto -60px; } }
@media (max-width: 460px) {
  .logo { width: 120px; }
  .logo--overlap { width: 140px; margin: 20px auto -40px; }
}

/* === Component: divider (red rule under the logo on inner pages) === */
.divider { display: block; width: 100%; max-width: var(--content-max); height: 2px; background: var(--color-red-alt); margin: 0 auto 40px; }

/* === Component: page-title (centred H1 on inner pages) === */
.page-title { text-align: center; margin-bottom: 40px; }

/* === Component: hero (home: background photo, uppercase H1, yellow rule, outlined button) === */
.hero { position: relative; padding: 20% 20px; background-size: cover; background-position: center; text-align: center; }
.hero__title {
  position: relative; color: var(--color-white); text-transform: uppercase;
  font-size: 1.5em; line-height: 1; margin: 0 0 60px; text-shadow: var(--shadow-text);
}
.hero__title::after {
  content: ""; position: absolute; left: 50%; margin-left: -25px; bottom: -30px;
  width: 50px; height: 3px; background: var(--color-yellow); box-shadow: var(--shadow-text);
}

/* === Component: button-outline (white outlined ORDER NOW; fills red on hover) === */
.button-outline {
  display: block; width: 140px; margin: auto; padding: 5px; box-sizing: content-box;
  border: 1px solid var(--color-white); color: var(--color-white);
  text-transform: uppercase; font-size: 0.8em; line-height: 1.5;
  transition: all var(--duration-fast) linear;
}
.button-outline:hover, .button-outline:focus { color: var(--color-white); background: var(--color-red-hover); }

/* === Component: button (white block button, red on hover; the original form's Send button) === */
.button {
  display: inline-block; padding: 10px 26px 8px; background: var(--color-white); color: var(--color-text);
  border: 2px solid var(--color-white); font: inherit; font-size: 1em; line-height: 1em; text-align: center;
  cursor: pointer; transition: all var(--duration-fast) linear;
}
.button:hover, .button:focus { background: var(--color-red); color: var(--color-white); }

/* === Component: tiles (home row of three: branch, contact, branch) === */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 30px; margin-top: 30px; }
@media (max-width: 768px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; margin-top: 20px; }
  .tiles .photo-tile { display: none; }
}
@media (max-width: 460px) {
  .tiles { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
}

/* === Component: branch-tile (red tile; each line scaled to fill the width, replaces jQuery BigText) ===
 * Each line sets --fit = font-size ÷ text-column width, measured from BigText on the original.
 * The text column is a size container, so 100cqi = its width. */
.branch-tile { display: block; background: var(--color-red-alt); color: var(--color-white); }
.branch-tile:hover, .branch-tile:focus { color: var(--color-white); }
.branch-tile__lines { display: block; padding: 20px 15%; line-height: 0.9; }
.branch-tile__lines-inner { display: block; container-type: inline-size; }
.branch-tile__line { display: block; white-space: nowrap; font-size: calc(var(--fit) * 100cqi); }
.branch-tile__accent { color: var(--color-yellow); }
.branch-tile__line:nth-child(1) { --fit: var(--fit-1); }
.branch-tile__line:nth-child(2) { --fit: var(--fit-2); }
.branch-tile__line:nth-child(3) { --fit: var(--fit-3); }
.branch-tile__line:nth-child(4) { --fit: var(--fit-4); }
/* Ratios per branch (font-size ÷ text width, from the original's BigText output) */
.branch-tile--aldershot { --fit-1: 0.1616; --fit-2: 0.1009; --fit-3: 0.2479; --fit-4: 0.0936; }
.branch-tile--farnborough { --fit-1: 0.1228; --fit-2: 0.0753; --fit-3: 0.2068; --fit-4: 0.1516; }
@media (max-width: 460px) { .branch-tile__lines { padding: 20px 25%; } }

/* === Component: photo-tile (greyscale photo tile with big caption; darkens on hover) === */
.photo-tile {
  display: flex; align-items: center; justify-content: center; container-type: inline-size;
  background-color: var(--color-red-alt); background-size: cover; background-position: center;
  color: var(--color-white); text-transform: uppercase; text-align: center; line-height: 1;
  box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0); transition: box-shadow var(--duration-fast) linear;
}
.photo-tile__text { font-size: 12.8cqi; white-space: nowrap; }
.photo-tile:hover, .photo-tile:focus { color: var(--color-white); box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.5); }
.photo-tile--chicken { background-image: url("/assets/images/chicken-bw.jpg"); }

/* === Component: entry-content (body copy on inner pages) === */
.entry-content img { width: 100%; height: auto; display: inline; }
.entry-content--center { text-align: center; }

/* === Component: contact-email (replaces the Contact Form 7 form, on the original's green panel) === */
.contact-email {
  display: block; position: relative; overflow: hidden; margin-top: 40px; padding: 20px;
  background: var(--color-green); color: var(--color-white);
}
.contact-email p { margin: 0 0 18px; }
.contact-email p:last-child { margin-bottom: 0; }
.contact-email a:not(.button) { color: var(--color-white); text-decoration: underline; }
.contact-email__address { word-break: break-word; }

/* === Component: site-footer (green; hygiene rating badge, copyright, credit) === */
.site-footer { margin-top: 50px; padding: 20px; background: var(--color-green); color: var(--color-white); text-align: center; }
.site-footer__badge { display: block; width: 120px; margin: 0 auto 20px; border-radius: 3px; }
.site-footer__copyright { font-size: 0.8em; line-height: 1.5; margin: 0; }
.site-footer__copyright a, .site-footer__copyright a:hover { color: var(--color-white); }

/* ============ 6. Pages ============ */
/* === Page: /404 === */
.not-found__links { list-style: none; margin: 0 0 18px; padding: 0; }
.not-found__links li { margin-bottom: 12px; }

/* ============ 7. Utilities ============ */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-center { text-align: center; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
