/*
Theme Name: Spain Food Guide
Theme URI: https://spainfoodguide.com
Author: Always Booked
Description: Premium editorial food and travel publication for Spain. Custom block theme with Playfair Display + Lato and a warm Iberian palette (terracotta, ochre, saffron, cream).
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: spain-food-guide
Tags: food, travel, editorial, magazine, block-theme, full-site-editing
*/

/* Block theme — most styling lives in theme.json. This file exists for the header only. */

/* Editorial touches that don't fit cleanly in theme.json */
.sfg-category-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wp--preset--color--ochre);
}

.sfg-byline {
  font-size: 0.85rem;
  color: var(--wp--preset--color--muted);
}

.sfg-card:hover img {
  transform: scale(1.03);
  transition: transform 500ms ease;
}

.sfg-card img {
  transition: transform 500ms ease;
}

.sfg-pull-quote {
  border-left: 3px solid var(--wp--preset--color--ochre);
  padding-left: 1.5rem;
  font-style: italic;
  font-family: var(--wp--preset--font-family--serif);
  font-size: 1.5rem;
  line-height: 1.5;
}

.sfg-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(42, 35, 32, 0.1) 0%, rgba(42, 35, 32, 0.55) 70%, rgba(42, 35, 32, 0.75) 100%);
}

/* ===== Hamburger button (hidden on desktop) ===== */
.sfg-hamburger {
  display: none;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
}
.sfg-hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: #2A2320;
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}
body.sfg-menu-open .sfg-hamburger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
body.sfg-menu-open .sfg-hamburger span:nth-child(2) { opacity: 0; }
body.sfg-menu-open .sfg-hamburger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Kill emoji auto-bloat everywhere */
img.emoji, img.wp-smiley {
  width: 1em !important;
  height: 1em !important;
  display: inline !important;
  vertical-align: -0.1em !important;
  margin: 0 0.05em !important;
}

/* ===== Mobile (≤ 768px) ===== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Show hamburger, hide inline nav by default on mobile */
  .sfg-hamburger { display: flex !important; }
  .sfg-nav { display: none !important; }

  /* When menu is open, drop nav down as a full-width panel */
  body.sfg-menu-open .sfg-nav {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    background: #F7F2E9;
    padding: 0.5rem 1.25rem 1.25rem !important;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.15);
    z-index: 999;
    font-size: 0.95rem !important;
    letter-spacing: 0.08em !important;
  }
  body.sfg-menu-open .sfg-nav a {
    padding: 0.85rem 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    text-align: left !important;
    background: transparent !important;
    color: #2A2320 !important;
  }
  body.sfg-menu-open .sfg-nav a.sfg-cta {
    margin-top: 0.75rem !important;
    background: #8B2E1F !important;
    color: #F7F2E9 !important;
    padding: 0.85rem 1.1rem !important;
    text-align: center !important;
    border-bottom: none !important;
  }

  /* Header must be position:relative so the menu panel can drop below it */
  header.wp-block-group {
    position: relative !important;
    padding: 0.9rem 1.1rem !important;
  }

  /* Larger logo + site title on mobile */
  .sfg-logo {
    width: 54px !important;
    height: 54px !important;
    font-size: 1.85rem !important;
  }
  .wp-block-site-title a,
  .wp-block-site-title {
    font-size: 1.2rem !important;
  }

  /* Hero: shorter, tighter padding */
  .wp-block-cover.alignfull {
    min-height: 78vh !important;
    padding: 4rem 1.1rem !important;
  }
  .wp-block-cover h1 {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
    line-height: 1.1 !important;
  }
  .wp-block-cover .wp-block-cover__inner-container p {
    font-size: 1rem !important;
    margin-bottom: 1.75rem !important;
  }
  .wp-block-cover .wp-block-buttons {
    flex-direction: column !important;
    gap: 0.6rem !important;
  }
  .wp-block-cover .wp-block-button,
  .wp-block-cover .wp-block-button__link {
    width: 100% !important;
    text-align: center !important;
  }

  /* Trim giant vertical padding on full-width sections */
  main > .wp-block-group.alignfull {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
    padding-left: 1.1rem !important;
    padding-right: 1.1rem !important;
  }

  /* About (image + text) section — stack to 1 column */
  .wp-block-columns.are-vertically-aligned-center {
    gap: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .wp-block-columns.are-vertically-aligned-center > .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }
  .wp-block-columns.are-vertically-aligned-center img {
    width: 100% !important;
    height: auto !important;
  }

  /* Card grids (Destinations etc): force 2-up instead of 1-up stacking */
  main .wp-block-columns:not(.are-vertically-aligned-center) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    flex-direction: row !important;
  }
  main .wp-block-columns:not(.are-vertically-aligned-center) > .wp-block-column {
    flex: 0 0 calc(50% - 0.5rem) !important;
    width: calc(50% - 0.5rem) !important;
    min-width: 0 !important;
  }

  /* Card images: shorter + consistent on mobile */
  .sfg-card img,
  .sfg-card-img img,
  figure.sfg-card-img img {
    height: 160px !important;
    width: 100% !important;
    object-fit: cover !important;
  }
  .sfg-card h3,
  .sfg-card .wp-block-heading {
    font-size: 1.05rem !important;
  }
  .sfg-card p {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
  }

  /* Section headings smaller on mobile */
  main h2.wp-block-heading {
    font-size: clamp(1.6rem, 6vw, 2.1rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }

  /* Essentials icons: keep contained, prevent emoji bloat */
  .wp-block-columns:not(.are-vertically-aligned-center) > .wp-block-column > div:first-child {
    font-size: 1.75rem !important;
    line-height: 1 !important;
    max-width: 3rem;
    margin: 0 auto 0.5rem !important;
  }
  .wp-block-columns:not(.are-vertically-aligned-center) img.emoji {
    width: 1.75rem !important;
    height: 1.75rem !important;
  }

  /* Footer cleanup */
  footer .wp-block-columns {
    gap: 1.75rem !important;
  }
}

/* ===== Very small phones (≤ 400px) ===== */
@media (max-width: 400px) {
  .wp-block-cover h1 { font-size: 1.9rem !important; }
  .sfg-card img, .sfg-card-img img { height: 130px !important; }
}
