/*
 * Capa base global: reset ligero, variables, tipografía, cabecera, menú overlay, pie, utilidades compartidas.
 * Páginas interiores añaden css/pages.css; la home añade css/home.css.
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-heading: 'Cormorant', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --color-accent: #d45b00;
  --color-accent-light: #9d724a;
  --color-text: #777;
  --color-text-emphasis: #333;
  --color-text-light: #6a6a6a;
  --color-link: #426694;
  --color-bg: #f5f5f0;
  --color-bg-cream: #f7f7f7;
  --color-bg-dark: #141414;
  --color-white: #fff;
  --max-width: 1200px;
  --header-height: 65px;
}

html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

strong,
b {
  font-weight: 600;
  color: var(--color-text-emphasis);
}

body.menu-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 2.25rem 2rem;
}

body.menu-open .site-header {
  position: fixed;
  z-index: 200;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header .logo img {
  height: var(--header-height);
  width: auto;
}

.logo-menu { display: none; }
body.menu-open .logo-default { display: none; }
body.menu-open .logo-menu { display: block; }

/* Hamburger */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-white);
  border-radius: 1px;
  transition: transform 0.35s ease, opacity 0.25s ease, background-color 0.3s ease;
  transform-origin: center;
}

body.menu-open .hamburger span { background: var(--color-text); }
body.menu-open .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .hamburger span:nth-child(2) { opacity: 0; }
body.menu-open .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Menu overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-white);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

body.menu-open .menu-overlay { opacity: 1; visibility: visible; }

.menu-overlay nav ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.menu-overlay nav ul li { overflow: hidden; }

.menu-overlay nav ul li a {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--color-text);
  padding: 0.2rem 0;
  text-align: center;
  transform: translateY(110%);
  transition: transform 0.3s ease, color 0.2s ease;
}

body.menu-open .menu-overlay nav ul li a {
  transform: translateY(0);
  transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1), color 0.2s ease;
  transition-delay: calc(var(--i, 0) * 60ms);
}

.menu-overlay nav ul li a:hover,
.menu-overlay nav ul li a.active { color: var(--color-accent); }

/* Footer */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.7);
}

.footer-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-white);
  font-size: 1rem;
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--color-accent); }

.footer-links .icon {
  color: var(--color-accent);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.footer-links .icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
}

.social-icons { display: flex; gap: 1.2rem; }

.social-icons a {
  color: var(--color-white);
  transition: color 0.3s;
}

.social-icons a:hover { color: var(--color-accent); }
.social-icons svg { width: 18px; height: 18px; fill: currentColor; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 2rem;
}

.footer-bottom p {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Scroll to top */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--color-bg-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s;
  z-index: 90;
}

.scroll-top svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 2;
}

.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--color-accent); }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }

/* Carousel dots */
.carousel-dots {
  display: none;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.2rem 0 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-dot.active { background: var(--color-accent); }

/* Responsive */
@media (max-width: 960px) {
  .site-header { padding: 1.5rem; }
  .site-header .logo img { height: 55px; }
  .header-inner { flex-direction: row-reverse; }
  .menu-overlay { padding: 3rem 2rem; }
  .menu-overlay nav ul li a { font-size: 7.5vw; line-height: 2; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .carousel-dots { display: flex; }
}

@media (max-width: 480px) {
  .footer-main { grid-template-columns: 1fr; padding: 3rem 1.5rem; }
}
