/*
Theme Name: AIPAL
Theme URI: https://www.aipal.pt/
Author: Júnior Ferreira
Description: Tema WordPress da AIPAL — Padarias e Pastelarias.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: aipal
*/

:root {
  --aipal-red: #c4142c;
  --aipal-red-dark: #9f1023;
  --aipal-cream: #f9f8f5;
  --aipal-paper: #f3f0ea;
  --aipal-brown: #3f3328;
  --aipal-muted: #706961;
  --aipal-border: #e1dbd2;
  --aipal-white: #fff;
  --aipal-max-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--aipal-cream);
  color: var(--aipal-brown);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.6;
}
body.admin-bar .site-header { top: 32px; }

img, video { display: block; max-width: 100%; }
a { color: inherit; }
.site-main { overflow: hidden; }
.container { width: min(100% - 3rem, var(--aipal-max-width)); margin-inline: auto; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; width: 1px; word-wrap: normal !important;
}

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  padding: 1.2rem 0;
  color: var(--aipal-white);
  transition: background-color .25s ease, box-shadow .25s ease, color .25s ease;
}
.site-header.is-scrolled, .site-header:focus-within {
  background: rgba(249,248,245,.96); color: var(--aipal-brown);
  box-shadow: 0 1px 0 var(--aipal-border);
  backdrop-filter: blur(8px);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.site-branding img { width: auto; height: 5.1rem; object-fit: contain; transition: filter .25s ease; }
.site-header:not(.is-scrolled) .site-branding img { filter: brightness(0) invert(1); }
.main-navigation ul { display: flex; align-items: center; gap: 2.4rem; list-style: none; margin: 0; padding: 0; }
.main-navigation a { font-size: .76rem; font-weight: 600; letter-spacing: .16em; text-decoration: none; text-transform: uppercase; }
.main-navigation a:hover, .main-navigation a:focus-visible { color: var(--aipal-red); }
.menu-toggle { display: none; border: 0; background: transparent; color: currentColor; cursor: pointer; font-size: 1.5rem; padding: .35rem; }

.hero { position: relative; min-height: 100vh; display: grid; place-items: center; color: var(--aipal-white); text-align: center; }
.hero__media, .hero__overlay { position: absolute; inset: 0; }
.hero__media { width: 100%; height: 100%; object-fit: cover; }
.hero__overlay { background: linear-gradient(180deg, rgba(0,0,0,.33), rgba(0,0,0,.46)); }
.hero__content { position: relative; z-index: 1; padding: 8rem 1.5rem 5rem; }
.hero h1, .section-title { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(2.25rem, 6vw, 5.3rem); line-height: 1.18; }
.hero h1 em { font-weight: 400; text-transform: none; }
.hero__tagline { margin: 2rem 0 0; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; }
.scroll-cue { position: absolute; bottom: 2rem; left: 50%; font-size: 1.6rem; opacity: .75; transform: translateX(-50%); }

.section { padding: 7rem 0; }
.section--paper { background: var(--aipal-paper); }
.section-title { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.2; text-align: center; }
.divider { width: 3rem; height: 1px; margin: 1.25rem auto; background: currentColor; opacity: .35; }
.body-copy { color: var(--aipal-muted); font-size: 1.05rem; }
.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; align-items: center; }
.story-grid .body-copy { text-align: justify; }
.story-video { width: 100%; height: 22rem; border-radius: .5rem; background: #111; object-fit: contain; box-shadow: 0 1rem 2rem rgba(63,51,40,.12); }

.products-grid, .locations-grid { display: grid; gap: 2rem; }
.products-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 5rem; }
.product-card__image { width: 100%; aspect-ratio: 4 / 5; margin-bottom: 1.2rem; overflow: hidden; background: var(--aipal-paper); }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .product-card__image img { transform: scale(1.05); }
.product-card h3 { margin: 0 0 .4rem; font-family: Georgia, 'Times New Roman', serif; font-size: 1.4rem; font-weight: 400; }
.product-card p { margin: 0; color: var(--aipal-muted); font-size: .9rem; }
.cta-wrap { margin-top: 4rem; text-align: center; }
.button { display: inline-block; border: 1px solid var(--aipal-brown); padding: .8rem 1.6rem; color: var(--aipal-brown); font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-decoration: none; text-transform: uppercase; transition: background .2s ease, color .2s ease; }
.button:hover, .button:focus-visible { background: var(--aipal-brown); color: var(--aipal-white); }
.button--red { border-color: var(--aipal-red); background: var(--aipal-red); color: var(--aipal-white); }
.button--red:hover, .button--red:focus-visible { border-color: var(--aipal-red-dark); background: var(--aipal-red-dark); }

.locations-banner { position: relative; min-height: 42vh; display: grid; place-items: center; color: var(--aipal-white); text-align: center; }
.locations-banner img, .locations-banner::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.locations-banner img { object-fit: cover; object-position: 50% 30%; }
.locations-banner::after { background: rgba(0,0,0,.4); content: ''; }
.locations-banner h2 { position: relative; z-index: 1; }
.locations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 5rem 0; }
.location-card { padding: 2rem; border: 1px solid var(--aipal-border); background: var(--aipal-cream); transition: transform .25s ease, box-shadow .25s ease; }
.location-card:hover { box-shadow: 0 1rem 2rem rgba(63,51,40,.1); transform: translateY(-.25rem); }
.location-card h3 { margin: 0 0 1.4rem; font-family: Georgia, 'Times New Roman', serif; font-size: 1.4rem; font-weight: 400; }
.location-card p { margin: .6rem 0; color: var(--aipal-muted); font-size: .9rem; }
.location-card p span { margin-right: .45rem; }
.location-card__link { display: inline-flex; gap: .45rem; margin-top: 1rem; font-size: .72rem; font-weight: 600; letter-spacing: .13em; text-decoration: none; text-transform: uppercase; }

.order-section { text-align: center; }
.order-section .body-copy { max-width: 42rem; margin: 2rem auto 0; }

.site-footer { background: var(--aipal-red); color: var(--aipal-white); }
.site-footer a { text-decoration: none; }
.footer__inner { padding: 4rem 0 1.5rem; }
.footer__grid { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 3rem; align-items: start; }
.footer__brand { text-align: center; }
.footer__brand img { width: auto; height: 5rem; margin: 0 auto .25rem; filter: brightness(0) invert(1); }
.footer__brand p, .footer__column p, .footer__column a { color: rgba(255,255,255,.68); font-size: .88rem; }
.footer__columns { display: flex; justify-content: center; gap: 3rem; }
.footer__column h3, .footer__social h3 { margin: 0 0 .6rem; color: rgba(255,255,255,.85); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.footer__column p { margin: .3rem 0; }
.footer__social { text-align: center; }
.footer__social-links { display: flex; justify-content: center; gap: 1.4rem; font-size: 1.35rem; }
.footer__institutions { display: flex; justify-content: center; align-items: center; gap: 3rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.14); }
.footer__institutions img { width: auto; height: 3rem; filter: brightness(0) invert(1); }
.footer__copyright { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.45); font-size: .7rem; text-align: center; }

@media (max-width: 800px) {
  body.admin-bar .site-header { top: 46px; }
  .container { width: min(100% - 2rem, var(--aipal-max-width)); }
  .site-header { padding: .7rem 0; }
  .site-branding img { height: 4rem; }
  .menu-toggle { display: block; }
  .main-navigation { display: none; position: absolute; inset: 100% 0 auto; padding: 1rem; background: var(--aipal-cream); color: var(--aipal-brown); box-shadow: 0 1rem 2rem rgba(0,0,0,.1); }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; gap: 1.2rem; align-items: center; }
  .story-grid, .locations-grid, .footer__grid { grid-template-columns: 1fr; }
  .section { padding: 4.5rem 0; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__columns { flex-direction: column; gap: 1.5rem; align-items: center; text-align: center; }
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .hero__tagline { font-size: .65rem; }
  .footer__institutions { flex-wrap: wrap; gap: 1.5rem; }
}
