/* ============================================
   QUINTA DE ALPORTEL — Custom Styles
   ============================================ */

/* Variables */
:root {
  --color-primary: #2d4a1e;
  --color-primary-light: #3d6428;
  --color-gold: #c9a84c;
  --color-cream: #f5f0e8;
  --color-dark: #1c1c1c;
  --color-text: #3a3a3a;
  --color-white: #ffffff;
  --color-overlay: rgba(10, 20, 5, 0.5);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Raleway', Arial, sans-serif;

  --nav-height: 80px;
  --transition: 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-white);
}

img { max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ============================================
   NAVBAR
   ============================================ */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--transition),
              box-shadow var(--transition),
              padding var(--transition);
  padding: 20px 0;
}

.nav-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo .logo-svg {
  height: 52px;
  width: auto;
  transition: color var(--transition);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 100%;
  height: 1px;
  background: currentColor;
  transition: right var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  right: 0;
}

/* Home — transparent nav */
.is-home #navbar {
  background: transparent;
}
.is-home #navbar .nav-logo,
.is-home #navbar .nav-links a,
.is-home #navbar .nav-toggle {
  color: var(--color-white);
}

/* Home — scrolled */
.is-home #navbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.08);
  padding: 12px 0;
}
.is-home #navbar.scrolled .nav-logo,
.is-home #navbar.scrolled .nav-links a,
.is-home #navbar.scrolled .nav-toggle {
  color: var(--color-dark);
}

/* Inner pages — always solid */
.is-inner #navbar {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.08);
  padding: 12px 0;
}
.is-inner #navbar .nav-logo,
.is-inner #navbar .nav-links a,
.is-inner #navbar .nav-toggle {
  color: var(--color-dark);
}

/* Hover & active */
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}
.is-home #navbar:not(.scrolled) .nav-links a:hover,
.is-home #navbar:not(.scrolled) .nav-links a.active {
  color: var(--color-gold);
}

/* Mobile toggle button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */

.lang-switcher {
  position: relative;
  margin-left: 1.2rem;
}

.lang-current {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  color: inherit;
  transition: border-color var(--transition);
}
.lang-current:hover {
  border-color: currentColor;
}

.lang-caret {
  font-size: 0.65rem;
  opacity: 0.65;
  line-height: 1;
}

.lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  list-style: none;
  padding: 0.35rem 0;
  min-width: 170px;
  z-index: 200;
}
.lang-switcher.open .lang-dropdown {
  display: block;
}
.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--color-dark);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  letter-spacing: 0.03em;
  transition: background var(--transition);
}
.lang-dropdown a:hover {
  background: var(--color-cream);
}
.lang-dropdown a.lang-active {
  font-weight: 700;
  color: var(--color-primary);
}
.lang-flag-img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  flex-shrink: 0;
}
.lang-name {
  flex: 1;
}
.lang-native {
  opacity: 0.55;
  font-size: 0.75rem;
}

/* Home transparent nav — make lang button white */
.is-home #navbar:not(.scrolled) .lang-current {
  color: var(--color-white);
}

/* ============================================
   HERO (shared)
   ============================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--color-white);
  padding: 40px 24px;
  max-width: 800px;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--color-white);
  opacity: 0.55;
  font-size: 1.6rem;
  animation: bounce 2s ease-in-out infinite;
}

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

/* ============================================
   HOME PAGE
   ============================================ */

.home-hero .hero-logo .logo-svg {
  width: 300px;
  height: auto;
  color: var(--color-white);
  margin-bottom: 32px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.25));
}

.hero-slogan {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.5;
  color: var(--color-cream);
}

/* ============================================
   HOME HISTORY SECTION
   ============================================ */

.home-history {
  background-color: var(--color-primary);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 100px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.history-box {
  background: rgba(255, 255, 255, 0.84);
  max-width: 780px;
  width: calc(100% - 180px);
  padding: 60px 64px;
  color: #1a1a1a;
}

.history-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.history-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.history-divider::before,
.history-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(45, 74, 30, 0.25);
}

.history-divider span {
  color: var(--color-gold);
  font-size: 1rem;
}

.history-box p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.9;
  color: #1a1a1a;
  margin-bottom: 1.4em;
}

.history-box p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .history-box {
    width: calc(100% - 60px);
    padding: 40px 32px;
  }
}

/* ============================================
   COMING SOON (Azeite / Vinho)
   ============================================ */

.coming-soon-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.coming-soon-text {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-style: italic;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* ============================================
   CONTACT PAGE
   ============================================ */

.contact-page {
  padding-top: var(--nav-height);
  height: calc(110vh - var(--nav-height));
  display: flex;
  flex-direction: column;
}

.contact-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.contact-map-col {
  position: relative;
}

.contact-map-col iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  background: #e8e4dc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}

.map-placeholder code {
  background: rgba(0,0,0,0.08);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85rem;
}

.contact-form-col {
  background: var(--color-cream);
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--color-primary);
  margin-bottom: 4px;
}

.contact-subtitle {
  font-size: 0.9rem;
  color: var(--color-text);
  opacity: 0.65;
  margin-bottom: 20px;
  font-weight: 300;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-primary);
}

.form-group input,
.form-group textarea {
  padding: 9px 14px;
  border: 1px solid rgba(45, 74, 30, 0.25);
  background: var(--color-white);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--color-dark);
  outline: none;
  transition: border-color var(--transition);
  border-radius: 2px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
}

.form-group textarea {
  resize: none;
  min-height: 80px;
}

.btn-submit {
  align-self: flex-start;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 11px 36px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  border-radius: 2px;
}

.btn-submit:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-success {
  color: #2d6a2d;
  background: #e8f5e8;
  padding: 16px;
  border-radius: 2px;
  font-size: 0.95rem;
  border-left: 3px solid #2d6a2d;
}

.form-error {
  color: #8b1a1a;
  background: #fff0f0;
  padding: 16px;
  border-radius: 2px;
  font-size: 0.95rem;
  border-left: 3px solid #8b1a1a;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 48px 24px;
}

.footer-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-logo .logo-svg {
  height: 60px;
  width: auto;
  color: rgba(255, 255, 255, 0.75);
}

.footer-copy {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-dark);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.4rem;
    color: var(--color-white) !important;
    letter-spacing: 3px;
  }

  .hero {
    background-attachment: scroll;
  }

  .home-hero .hero-logo .logo-svg {
    width: 220px;
  }

  .btn-submit {
    align-self: stretch;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nav-wrap {
    padding: 0 20px;
  }
}

@media (max-width: 900px) {
  .contact-columns {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .contact-map-col {
    min-height: 360px;
  }

  .contact-form-col {
    padding: 48px 28px;
  }
}

/* ============================================
   AZEITE PAGE
   ============================================ */

.azeite-page {
  min-height: 100vh;
  background-color: var(--color-primary);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.azeite-inner {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 80px;
}

.azeite-header {
  text-align: center;
  color: var(--color-white);
  padding: 0 24px 56px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55);
}

.azeite-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.azeite-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-style: italic;
  opacity: 0.9;
}

.azeite-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4%;
  padding: 0 6%;
  align-items: center;
}

.azeite-text-box {
  background: rgba(255, 255, 255, 0.82);
  padding: 44px 40px;
}

.azeite-text-heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(45, 74, 30, 0.2);
}

.azeite-text-box p {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.9;
  color: #1a1a1a;
  margin-bottom: 1.4em;
}

.azeite-text-box p:last-child {
  margin-bottom: 0;
}

.azeite-img-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.azeite-img-box img {
  max-width: 100%;
  max-height: 720px;
  object-fit: contain;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.4));
}

@media (max-width: 900px) {
  .azeite-grid {
    grid-template-columns: 1fr;
    padding: 0 5%;
    gap: 40px;
  }

  .azeite-img-box {
    order: -1;
  }

  .azeite-img-box img {
    max-height: 460px;
  }
}

/* ============================================
   PASSWORD PAGE
   ============================================ */

.pwd-body {
  margin: 0;
  padding: 0;
  background: var(--color-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(61, 100, 40, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 80%, rgba(10, 20, 5, 0.3) 0%, transparent 50%);
}

.pwd-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.pwd-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 56px 48px 48px;
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.pwd-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

.pwd-logo img {
  width: 240px;
  height: auto;
}

.pwd-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.pwd-divider::before,
.pwd-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(201, 168, 76, 0.45);
}

.pwd-divider span {
  color: var(--color-gold);
  font-size: 1rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.pwd-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.pwd-label {
  display: block;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
}

.pwd-input {
  width: 100%;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 3px;
  text-align: center;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.pwd-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 1px;
  font-size: 0.85rem;
}

.pwd-input:focus {
  border-color: rgba(201, 168, 76, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

.pwd-btn {
  width: 100%;
  padding: 15px;
  margin-top: 6px;
  background: transparent;
  color: var(--color-gold);
  border: 1px solid rgba(201, 168, 76, 0.6);
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pwd-btn:hover {
  background: var(--color-gold);
  color: var(--color-dark);
  border-color: var(--color-gold);
}

.pwd-error {
  text-align: center;
  color: rgba(255, 180, 180, 0.85);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-style: italic;
  margin: 4px 0 0;
}
