/* Quinta da Oliveira - Website Styles */
/* Matching the elegant PDF design: sage green, serif fonts, understated */
/* Mobile-first responsive design */

:root {
  --color-primary: #5d7a64;      /* Sage green from PDFs */
  --color-primary-dark: #4a6150;
  --color-text: #3d3d3d;         /* Dark grey body text */
  --color-text-light: #6b6b6b;
  --color-background: #ffffff;
  --color-background-alt: #f9f9f7;
  --color-divider: #5d7a64;
  --font-serif: 'Crimson Text', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Crimson Text', 'Georgia', serif;
  --max-width: 720px;
  --spacing-unit: 1.25rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Prevent font scaling in landscape on iOS */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  /* Ensure full width on mobile */
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography - Mobile first */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-primary);
  font-weight: 400;
  line-height: 1.3;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

strong {
  font-weight: 600;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
  /* Larger tap target */
  padding: 0.1em 0;
}

a:hover,
a:active {
  border-bottom-color: var(--color-primary);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

/* Header */
header {
  padding: 1.5rem 0 1rem;
  text-align: center;
  border-bottom: 1px solid #e8e8e8;
}

header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

header .subtitle {
  font-style: italic;
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Navigation - Mobile optimized */
nav {
  padding: 0.75rem 0;
  text-align: center;
  background-color: var(--color-background);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e8e8e8;
  /* Safe area for notched phones */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  font-size: 0.9rem;
  color: var(--color-text);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid transparent;
  /* Larger tap target for mobile */
  display: inline-block;
  min-height: 44px;
  display: flex;
  align-items: center;
}

nav a:hover,
nav a:active,
nav a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Main Content */
main {
  padding: 2rem 0 3rem;
}

/* Divider - Diamond symbol like in PDFs */
.divider {
  text-align: center;
  color: var(--color-divider);
  font-size: 1rem;
  margin: 2rem 0;
  letter-spacing: 0.5em;
}

.divider::before {
  content: "—";
  margin-right: 0.5em;
}

.divider::after {
  content: "—";
  margin-left: 0.5em;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-style: italic;
  color: var(--color-primary);
  font-size: 1rem;
}

/* Section Styling */
.section {
  margin-bottom: 1.5rem;
}

.section-centered {
  text-align: center;
}

.section-centered h2 {
  margin-bottom: 1rem;
}

/* Welcome text styling */
.welcome-text {
  font-style: italic;
  text-align: center;
  font-size: 1rem;
  color: var(--color-primary-dark);
  margin: 1.5rem 0;
}

/* Info boxes for practical information */
.info-box {
  background-color: var(--color-background-alt);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 3px solid var(--color-primary);
}

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

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem var(--spacing-unit);
  border-top: 1px solid #e8e8e8;
  color: var(--color-text-light);
  font-size: 0.85rem;
  /* Safe area for notched phones */
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

footer .location {
  font-style: italic;
  margin-bottom: 0.5rem;
}

/* Closing phrase like in PDFs */
.closing {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}

.closing .portuguese {
  font-style: italic;
  color: var(--color-primary);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.closing .english {
  color: var(--color-text-light);
}

/* Note text */
.note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* Weather Widget */
.weather-widget {
  text-align: center;
  padding: 1.5rem 1rem;
  margin: 0 0 1.5rem;
  background-color: var(--color-background-alt);
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.weather-loading,
.weather-error {
  color: var(--color-text-light);
  font-style: italic;
  font-size: 0.9rem;
}

.weather-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.weather-main {
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.weather-temp {
  font-weight: 600;
  color: var(--color-primary);
}

.weather-sep {
  margin: 0 0.4em;
  color: var(--color-text-light);
}

.weather-condition {
}

.weather-wind {
  color: var(--color-text-light);
}

.weather-advice {
  font-style: italic;
  color: var(--color-primary-dark);
  font-size: 0.95rem;
}

/* ===========================================
   TABLET STYLES (768px and up)
   =========================================== */
@media (min-width: 768px) {
  html {
    font-size: 17px;
  }

  :root {
    --spacing-unit: 1.5rem;
  }

  header {
    padding: 2rem 0 1.25rem;
  }

  header h1 {
    font-size: 2rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
  }

  nav ul {
    gap: 2rem;
  }

  nav a {
    font-size: 0.95rem;
  }

  main {
    padding: 2.5rem 0 3.5rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero .tagline {
    font-size: 1.1rem;
  }

  .divider {
    margin: 2.5rem 0;
  }

  .info-box {
    padding: 1.25rem 1.5rem;
  }
}

/* ===========================================
   DESKTOP STYLES (1024px and up)
   =========================================== */
@media (min-width: 1024px) {
  html {
    font-size: 18px;
  }

  header h1 {
    font-size: 2.2rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  main {
    padding: 3rem 0 4rem;
  }

  .hero h1 {
    font-size: 2.8rem;
  }
}

/* ===========================================
   TOUCH DEVICE OPTIMIZATIONS
   =========================================== */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets */
  a {
    padding: 0.2em 0;
  }

  nav a {
    padding: 0.75rem 0.5rem;
  }

  /* Remove hover states on touch */
  a:hover {
    border-bottom-color: transparent;
  }

  a:active {
    border-bottom-color: var(--color-primary);
  }
}

/* ===========================================
   LANDSCAPE PHONE
   =========================================== */
@media (max-height: 500px) and (orientation: landscape) {
  header {
    padding: 1rem 0 0.75rem;
  }

  nav {
    padding: 0.5rem 0;
  }

  main {
    padding: 1.5rem 0 2rem;
  }
}

/* ===========================================
   DARK MODE SUPPORT (optional)
   =========================================== */
@media (prefers-color-scheme: dark) {
  /* Uncomment below to enable dark mode
  :root {
    --color-background: #1a1a1a;
    --color-background-alt: #242424;
    --color-text: #e8e8e8;
    --color-text-light: #a0a0a0;
    --color-primary: #7d9a84;
  }
  */
}

/* ===========================================
   REDUCED MOTION
   =========================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  a {
    transition: none;
  }
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
  nav {
    display: none;
  }

  header {
    border-bottom: none;
  }

  main {
    padding: 1rem 0;
  }

  .container {
    max-width: none;
  }
}
