/* style.css
   Keep base styles (fonts, type scale, colors, buttons, links, etc.) in base.css.
   This file only contains layout + component styles used across pages, plus a few page-specific helpers.
*/

/* ===============================
   Navigation
   =============================== */

:root {
  /* Easing for menu button animation */
  --ease-standard: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-in: cubic-bezier(0.42, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.58, 1);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);

  /* Nav tokens mapped to your cooking site system */
  --clr-nav-background: var(--headerFooter-bg); /* Chocolate Brown */
  --clr-nav: var(--headerFooter-color);         /* Cream */
  --clr-nav-hover-bg: var(--link-color);        /* Tomato Red */
  --clr-nav-hover: var(--button-text-color);    /* White */
}

/* Header as a vertical stack: topbar, then nav */
header {
  background: var(--clr-nav-background);
  color: var(--clr-nav);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.logo {
  color: var(--clr-nav);
  text-decoration: none;
  font-family: var(--font-heading); /* Merriweather */
  font-weight: 700;
  font-size: var(--text-size-xl);
  line-height: 1.1;
}

/* Hamburger button */
.menu-button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--clr-nav);
  border-radius: 1px;
  transition:
    transform 300ms var(--ease-standard),
    opacity 200ms var(--ease-standard);
  transform-origin: center;
}

.menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

nav {
  background: var(--clr-nav-background);
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;

  max-height: 0;
  opacity: 0;
  transition:
    max-height 520ms var(--ease-in-out),
    opacity 260ms var(--ease-in-out);
}

.menu.is-open {
  max-height: 80vh;
  opacity: 1;
}

.menu li + li {
  border-top: 2px solid rgba(247, 241, 229, 0.45); /* Cream border */
}

.menu a {
  display: block;
  padding: 1rem;
  text-align: center;
  color: var(--clr-nav);
  text-decoration: none;
  font-family: var(--font-primary); /* Lato */
  font-weight: 700;
  font-size: var(--text-size-md);
}

.menu a:hover,
.menu a:focus-visible {
  background: var(--clr-nav-hover-bg);
  color: var(--clr-nav-hover);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .menu { transition: none; }
}

@media (min-width: 1240px) {
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
  }

  .topbar { display: contents; }
  .menu-button { display: none; }
  nav { background: transparent; }

  .menu {
    max-height: none;
    opacity: 1;
    overflow: visible;
    transition: none;
    display: flex;
    gap: 0.5rem;
  }

  .menu li + li { border-top: none; }

  .menu a {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    transition:
      background 180ms var(--ease-standard),
      color 180ms var(--ease-standard);
  }
}

/* ===============================
   Shared layout blocks
   =============================== */

.hero {
  padding: var(--spacing-2xl) var(--spacing-md);
  text-align: center;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
}

.hero h1 {
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
}

.hero-lead {
  max-width: 620px;
  margin: 0 auto;
  color: var(--primary-color);
}

.section-divider {
  border: 0;
  height: 1px;
  background: rgba(90, 56, 37, 0.15);
  margin: 0 var(--spacing-md) var(--spacing-2xl);
}

.eyebrow {
  margin: 0 0 var(--spacing-sm);
  font-family: var(--font-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary-color);
}

/* Cards + grid used on Home, Basics, Recipes */
.section-title {
  margin-top: 0;
  margin-bottom: var(--spacing-lg);
}

.card-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

.recipe-card {
  background: var(--secondary-bg);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(50, 74, 95, 0.1);
  text-align: left;

  /* button alignment for different text lengths */
  display: flex;
  flex-direction: column;
}

.card-media {
  padding: var(--spacing-md);
}

.card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
}

.card-body {
  padding: var(--spacing-md);

  /* button alignment for different text lengths */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-title {
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
}

.card-text {
  margin-bottom: var(--spacing-md);
}

/* push any .btn in card bodies to bottom-left */
.card-body .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Secondary button variant */
.btn.btn-secondary {
  background: var(--secondary-link-color);
  color: #ffffff;
}
.btn.btn-secondary:hover,
.btn.btn-secondary:focus {
  background: var(--secondary-link-hover-color);
  outline-color: var(--secondary-link-hover-color);
}

.site-footer {
  background: var(--headerFooter-bg);
  color: var(--headerFooter-color);
  text-align: center;
  padding: var(--spacing-md);
  font-size: var(--text-size-sm);
}

/* Shared responsive grid behavior */
@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===============================
   Home page
   =============================== */

.featured {
  padding: 0 var(--spacing-md) var(--spacing-2xl);
}

.featured-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.featured-copy {
  max-width: 480px;
}

.featured-image {
  width: 100%;
  max-width: 560px;
  height: 320px;
  object-fit: cover;
  border-radius: 14px;
}

.popular {
  padding: 0 var(--spacing-md) var(--spacing-2xl);
  text-align: center;
}

@media (min-width: 900px) {
  .featured-inner {
    grid-template-columns: 1fr 1.2fr;
  }
}

/* ===============================
   About page
   =============================== */

.about-content {
  padding: 0 var(--spacing-md) var(--spacing-2xl);
}

.about-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.about-photo {
  width: 100%;
  max-width: 420px;
  height: 320px;
  object-fit: cover;
  border-radius: 14px;
}

.about-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

@media (min-width: 900px) {
  .about-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===============================
   Basics page
   =============================== */

.basics-hero {
  padding-bottom: var(--spacing-xl);
}

.beginner {
  padding: 0 var(--spacing-md) var(--spacing-2xl);
}

.beginner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.beginner-photo {
  width: 100%;
  max-width: 520px;
  height: 320px;
  object-fit: cover;
  border-radius: 14px;
}

.beginner-actions {
  margin-top: var(--spacing-md);
}

@media (min-width: 900px) {
  .beginner-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===============================
   Recipes page
   =============================== */

.recipes-hero {
  padding-bottom: var(--spacing-xl);
}

.recipes-section {
  padding: 0 var(--spacing-md) var(--spacing-2xl);
}

.recipes-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.recipes-section-header {
  text-align: left;
  max-width: 720px;
  margin-bottom: var(--spacing-lg);
}

.recipes-section-lead {
  margin-top: 0;
  color: var(--primary-color);
}

.recipes-grid {
  text-align: left;
}
/* FIX: Recipes page header block looking wrong */
.recipes-section-header {
  background: transparent;               /* prevents brown block */
  padding: 0;                            /* avoid big box look */
}

/* Make sure the Popular Recipes heading is readable */
.recipes-section-header h2 {
  color: var(--secondary-color);         /* chocolate brown (on cream bg) */
}

/* Keep the description readable */
.recipes-section-lead {
  color: var(--primary-color);
}
.recipes-section {
  text-align: center;
}
/* Fix Popular Recipes layout: stack title + text vertically */
.recipes-section-header {
  display: block;              /* override any grid/flex */
  text-align: left;
  max-width: 720px;
  margin-bottom: var(--spacing-lg);
}

/* Ensure description sits below heading */
.recipes-section-header h2 {
  margin-bottom: var(--spacing-sm);
}

.recipes-section-lead {
  margin-top: 0;
}

/* Add to the bottom of style.css (Videos page layout only) */

/* Constrain videos page content to match other pages */
.videos-featured {
  padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-2xl);
}

.videos-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.videos-inner h1 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  text-align: left; /* matches mock */
}

/* Space between video and description */
.videos-description {
  max-width: 760px;
  margin-top: var(--spacing-md);
}

/* More Videos section centered title like mock */
.videos-more .section-title {
  text-align: center;
}

/* Make the embedded iframes inside cards match the card radius */
.recipe-card .videoWrapper iframe {
  border-radius: 12px;
}
/* ===============================
   Accordion (Interactive Element)
   =============================== */

.tips {

  padding: 0 var(--spacing-md) var(--spacing-2xl);
}

.tips-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.tips-lead {
  max-width: 100%;
  margin-top: 0;
  margin-bottom: var(--spacing-lg);
}

.accordion {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  padding: 0;
  width: 100%;
}

.accordion-item {
  flex: 1;
  border: none;
  border-radius: 0;
  background: var(--secondary-bg);
  overflow: visible;
  margin: 0;
  position: relative;
}

.accordion-item + .accordion-item {
  margin-top: 0;
  border-left: 1px solid rgba(50, 74, 95, 0.12);
}

/* IMPORTANT: higher specificity so it beats base button styles */
.accordion .accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  padding: var(--spacing-md);
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--text-size-md);
  color: var(--secondary-color);
  outline: none;
  transition: background 200ms ease, color 200ms ease;
  min-height: 80px;
}

.accordion .accordion-trigger:hover,
.accordion .accordion-trigger:focus-visible {
  background: var(--link-color) !important;
  color: white !important;
}

.accordion .accordion-trigger[aria-expanded="true"] {
  background: var(--link-color) !important;
  color: white !important;
}

.accordion-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--secondary-bg);
  padding: var(--spacing-md);
  color: var(--primary-color);
  border: 1px solid rgba(50, 74, 95, 0.12);
  z-index: 10;
  display: none;
}

.accordion-panel:not([hidden]) {
  display: block;
}

.accordion-panel[hidden] {
  display: none;
}