/* =========================================================
   THEME VARIABLES
   --------------------------------------------------------- */
:root {
  --bg: #f9f8f6;
  --surface: #f1efe8;
  --primary: #b6a16b;
  --secondary: #6a8a82;
  --hover: #8b7355;
  --text: #2f2f2f;

  --radius: 12px;
  --transition: 0.2s ease;
}

/* =========================================================
   GLOBAL
   --------------------------------------------------------- */
html {
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

h1,
h2,
h3 {
  color: var(--secondary);
  font-weight: 600;
}

a {
  color: var(--secondary);
  text-decoration: underline;
  transition: color var(--transition);
}

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

/* =========================================================
   COMMON PATTERNS
   --------------------------------------------------------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

button {
  background-color: var(--primary);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.2rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition);
}

button:hover {
  background-color: var(--hover);
}

/* Simple stacked page layout for multiple pages */
.about-page,
.rules-page,
.contact-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* =========================================================
   HEADER & NAVIGATION
   --------------------------------------------------------- */
header {
  background-color: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition:
    background-color var(--transition),
    color var(--transition);
}

nav a:hover,
nav a.active {
  background-color: var(--primary);
  color: #fff;
}

/* =========================================================
   MAIN CONTENT
   --------------------------------------------------------- */
main p {
  margin-bottom: 1rem;
}

/* =========================================================
   AVALUHEHT / HOME PAGE
   --------------------------------------------------------- */
.home-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.home-hero {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-hero-text p {
  margin-bottom: 0.6rem;
}

.home-hero-meta {
  font-size: 0.95rem;
  color: #555;
}

.home-hero-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* button-like links, reusing your color variables */
.btn-link {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background-color var(--transition);
}

.btn-link:hover {
  background-color: var(--hover);
  color: #fff;
}

.btn-link-secondary {
  background-color: #fff;
  color: var(--secondary);
  border: 1px solid var(--primary);
}

.btn-link-secondary:hover {
  background-color: var(--surface);
}

/* hero gallery / carousel */
.home-hero-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.home-hero-gallery-caption {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

/* minimal carousel */
.carousel {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide.active {
  opacity: 1;
}

/* highlights */
.home-highlights {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.home-highlight h2 {
  margin-top: 0;
}

@media (min-width: 768px) {
  .home-hero {
    flex-direction: row;
    align-items: center;
  }

  .home-hero-text,
  .home-hero-gallery {
    flex: 1;
  }

  .home-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   ABOUT PAGE
   --------------------------------------------------------- */
.about-page ul {
  margin: 0.5rem 0 0.8rem 1.2rem;
}

.about-page li {
  margin-bottom: 0.3rem;
}

/* PDF Viewer */
.pdf-frame {
  width: 100%;
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.pdf-frame iframe {
  width: 100%;
  min-height: 80vh;
  border: none;
}

/* =========================================================
   PÄEVAKAVA
   --------------------------------------------------------- */
.schedule-page h1 {
  margin-top: 0;
}

.tab-buttons {
  display: flex;
  gap: 1rem;
  margin: 1.2rem 0 1.8rem;
  flex-wrap: wrap;
}

.tab-buttons button {
  background-color: #fff;
  color: var(--text);
  border: 1px solid var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  transition:
    background-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

.tab-buttons button:hover {
  background-color: var(--surface);
  color: var(--secondary);
}

.tab-buttons button.active {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Schedule tables */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.schedule-table td {
  border-bottom: 1px solid #ddd;
  padding: 0.6rem 0.8rem;
  vertical-align: top;
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.schedule-table td:first-child {
  font-weight: 600;
  width: 35%;
  color: var(--secondary);
  white-space: nowrap;
}

/* =========================================================
   KODUKORD
   --------------------------------------------------------- */
.rules-page ul {
  margin-left: 1.5rem;
  list-style-type: disc;
}

.rules-page li {
  margin-bottom: 0.6rem;
}

/* =========================================================
   KONTAKT
   --------------------------------------------------------- */
.contact-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.contact-section h1 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  color: var(--secondary);
  border-bottom: 2px solid var(--primary);
  display: inline-block;
  padding-bottom: 0.2rem;
}

/* contact cards just reuse .card */
.contact-card p {
  margin: 0.3rem 0;
}

/* Map box */
.map-wrapper {
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.map-wrapper iframe {
  width: 100%;
  height: 350px;
  border: none;
}

/* --- side-by-side layout on wider screens --- */
@media (min-width: 900px) {
  .contact-page {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: flex-start;
  }

  /* first two sections (emails + phones) on the left */
  .contact-section:nth-child(1),
  .contact-section:nth-child(2) {
    grid-column: 1;
  }

  /* map section on the right, spanning the height */
  .contact-section:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* =========================================================
   FOOTER
   --------------------------------------------------------- */
footer {
  margin-top: 3rem;
  padding: 2rem 1rem;
  background-color: var(--surface);
  text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.04);
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-info p {
  margin: 0.2rem 0;
}

.footer-info a {
  text-decoration: none;
}

.footer-info a:hover {
  text-decoration: underline;
}

.footer-legal {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #777;
}
