/* ============================================
   TOPOLINO — Static Site Stylesheet
   Mediterranean Agritourism · Island of Rab
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  --color-primary: #C85A3A;
  --color-primary-dark: #A34428;
  --color-primary-light: #E07B5F;
  --color-accent: #8B6F4E;
  --color-olive: #6B7F3B;
  --color-olive-light: #8EA65B;
  --color-navy: #1E2D3D;
  --color-stone: #F5F0E8;
  --color-stone-dark: #E8DFD1;
  --color-cream: #FDFBF7;
  --color-text: #3A3A3A;
  --color-text-light: #6B6B6B;
  --color-text-muted: #9A9A9A;
  --color-white: #FFFFFF;
  --color-black: #1A1A1A;
  --color-overlay: rgba(30, 45, 61, 0.65);
  --color-glass: rgba(255, 255, 255, 0.12);
  --color-glass-border: rgba(255, 255, 255, 0.18);

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --shadow-hero: 0 16px 48px rgba(0,0,0,0.20);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  --container-max: 1140px;
  --container-narrow: 800px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-navy);
}

p {
  margin-bottom: 1em;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ---------- Scroll Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background var(--transition-base), box-shadow var(--transition-base), padding var(--transition-base);
}

.nav.scrolled {
  background: rgba(30, 45, 61, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 24px rgba(0,0,0,0.15);
  padding: 8px 0;
}

.nav.menu-open {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  background: transparent;
  transition: all var(--transition-fast);
}

.nav__logo img {
  height: 84px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(1px 1px 0px rgba(255, 255, 255, 0.85)) 
          drop-shadow(-1px -1px 0px rgba(255, 255, 255, 0.85)) 
          drop-shadow(1px -1px 0px rgba(255, 255, 255, 0.85)) 
          drop-shadow(-1px 1px 0px rgba(255, 255, 255, 0.85))
          drop-shadow(0 2px 12px rgba(0, 0, 0, 0.4));
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.nav__logo:hover img {
  transform: scale(1.04);
  filter: drop-shadow(1px 1px 0px #ffffff) 
          drop-shadow(-1px -1px 0px #ffffff) 
          drop-shadow(1px -1px 0px #ffffff) 
          drop-shadow(-1px 1px 0px #ffffff)
          drop-shadow(0 0 8px rgba(240, 214, 137, 0.8));
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary-light);
  transition: width var(--transition-base);
  border-radius: 1px;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--color-white);
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

.nav__lang {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-xl);
  padding: 3px 4px;
  margin-left: 8px;
}

.nav__lang button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav__lang button.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.nav__lang button:hover:not(.active) {
  color: var(--color-white);
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav__hamburger span {
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav__hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(30, 45, 61, 0.55) 0%,
    rgba(30, 45, 61, 0.35) 40%,
    rgba(30, 45, 61, 0.70) 100%
  );
}

.hero__content {
  position: relative;
  text-align: center;
  color: var(--color-white);
  max-width: 720px;
  padding: 0 24px;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.3s forwards;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.1;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.5s forwards;
}

.hero__desc {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  max-width: 540px;
  margin: 0 auto 32px;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.7s forwards;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(200, 90, 58, 0.35);
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.9s forwards;
}

.hero__cta:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 90, 58, 0.45);
}

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  animation: bounce 2s ease-in-out infinite;
}

.hero__scroll svg {
  width: 28px;
  height: 28px;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ---------- Sections ---------- */
.section {
  padding: 100px 0;
}

.section--stone {
  background-color: var(--color-stone);
}

.section--dark {
  background-color: var(--color-navy);
  color: var(--color-stone);
}

.section--dark h2, .section--dark h3 {
  color: var(--color-white);
}

.section__header {
  text-align: center;
  margin-bottom: 56px;
}

.section__label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.section__title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}

.section__divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  margin: 0 auto 24px;
  border-radius: 2px;
}

.section__desc {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-light);
  max-width: 640px;
  margin: 0 auto;
}

.section--dark .section__desc {
  color: rgba(245, 240, 232, 0.75);
}

/* ---------- About / Topolino ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about__text h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--color-navy);
}

.about__text p {
  color: var(--color-text-light);
  line-height: 1.8;
}

.about__video {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 9.5;
}

.about__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Features Row ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card__icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.feature-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--color-navy);
}

.feature-card__text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ---------- Food / Wine Content ---------- */
.content-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.content-block--reverse {
  direction: rtl;
}

.content-block--reverse > * {
  direction: ltr;
}

.content-block__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.content-block__image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.content-block__image:hover img {
  transform: scale(1.03);
}

.content-block__text h3 {
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.content-block__text p {
  color: var(--color-text-light);
  line-height: 1.8;
  font-size: 0.98rem;
}

/* ---------- Gallery ---------- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.gallery__item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(30,45,61,0.5) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery__item:hover img {
  transform: scale(1.08);
}

.gallery__item:hover::after {
  opacity: 1;
}

.gallery__item-label {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  color: var(--color-white);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-base);
}

.gallery__item:hover .gallery__item-label {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hero);
  cursor: default;
  animation: lightboxIn 0.3s ease-out;
}

.lightbox__close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--color-white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.25);
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact__info {
  padding: 40px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.contact__info h3 {
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.contact__item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.contact__item-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-white);
}

.contact__item-text h4 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.contact__item-text p {
  color: var(--color-text);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

.contact__item-text a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.contact__item-text a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.contact__subtitle {
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: -16px;
  margin-bottom: 24px;
}

.contact__map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 1 / 1;
  min-height: 400px;
}

.contact__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 32px 0;
  font-size: 0.85rem;
}

.footer a {
  color: rgba(255,255,255,0.7);
}

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

/* ---------- Language Toggle ---------- */
[data-lang] {
  display: none;
}

[data-lang].lang-active {
  display: block;
}

/* Inline lang elements */
span[data-lang].lang-active,
a[data-lang].lang-active {
  display: inline;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .about__grid,
  .content-block,
  .contact__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .content-block--reverse {
    direction: ltr;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section {
    padding: 72px 0;
  }
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 45, 61, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    z-index: 999;
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__lang {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none;
  }

  .nav__links.open ~ .nav__lang {
    display: flex;
  }

  .nav__logo {
    padding: 0;
  }

  .nav__logo img {
    height: 72px;
  }

  .hero__title {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
  }

  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .section {
    padding: 56px 0;
  }
  
  .section__title {
    font-size: 2.2rem;
  }

  .content-block__image img {
    height: 280px;
  }
  
  .contact__map {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .gallery__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .container {
    padding: 0 16px;
  }

  .section {
    padding: 48px 0;
  }

  .hero__title {
    font-size: clamp(2rem, 10vw, 2.5rem);
  }
  
  .hero__desc {
    font-size: 1rem;
    margin-bottom: 24px;
  }
  
  .about__grid,
  .content-block,
  .contact__grid {
    gap: 32px;
  }
  
  .feature-card {
    padding: 20px 16px;
  }

  .content-block__image img {
    height: 220px;
  }
  
  .content-block__text h3 {
    font-size: 1.4rem;
  }

  .contact__info {
    padding: 20px 16px;
  }
  
  .contact__item {
    gap: 12px;
    margin-bottom: 20px;
  }
  
  .contact__item-icon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .contact__map {
    min-height: 250px;
  }
}
