/* Skip to content - Accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  z-index: 100;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
}

/* Base styles */
:root {
  --color-primary: #2d5a27;
  --color-secondary: #8bc34a;
  --color-text: #333;
  --color-light: #f5f5f5;
  --color-white: #fff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
}

/* Header */
header {
  background: var(--color-primary);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, padding 0.3s ease;
}

/* Header scrolled state - transparent with blur */
header.header-scrolled {
  background: rgba(45, 90, 39, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 2rem;
}

/* Header becomes more opaque on hover when scrolled */
header.header-scrolled:hover {
  background: rgba(45, 90, 39, 0.85);
}

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

header .logo {
  color: var(--color-white);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header .logo-img {
  border-radius: 4px;
}

header .nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

header .nav-menu a {
  color: var(--color-white);
  text-decoration: none;
}

header .nav-menu a:hover,
header .nav-menu a[aria-current="page"] {
  text-decoration: underline;
}

/* Hamburger menu button */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hamburger animation when open */
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Images */
picture {
  display: block;
}

picture img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.img-float {
  margin: 1rem;
}

.img-float--right {
  float: right;
  margin-right: 0;
  margin-left: 1.5rem;
}

.img-float--left {
  float: left;
  margin-left: 0;
  margin-right: 1.5rem;
}

@media (max-width: 480px) {
  .img-float {
    float: none;
    margin: 1rem 0;
  }

  .img-float img {
    width: 100%;
  }
}

/* Clearfix for floated images */
.content::after {
  content: "";
  display: table;
  clear: both;
}

/* Main content */
main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1, h2, h3 {
  color: var(--color-primary);
  margin: 1.5rem 0 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

ul, ol {
  margin: 1rem 0 1rem 2rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: var(--color-light);
}

/* Page list */
.page-list {
  list-style: none;
  margin-left: 0;
}

.page-list li {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-light);
  border-radius: 4px;
}

.page-list a {
  color: var(--color-primary);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Map - OpenStreetMap */
#map {
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 1rem;
  line-height: 1.6;
}

.leaflet-popup-content b {
  color: var(--color-primary);
  font-size: 1.1rem;
}

.leaflet-control-zoom a {
  color: var(--color-primary) !important;
}

.leaflet-control-zoom a:hover {
  background-color: var(--color-secondary) !important;
  color: var(--color-white) !important;
}

/* Footer */
footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 3rem 2rem 1rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col h3 {
  color: var(--color-white);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-secondary);
}

.footer-col p {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col .siren {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 1rem;
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.8;
}

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

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

/* Focus states - Accessibility */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  header nav {
    flex-wrap: wrap;
    gap: 0;
  }

  header .logo {
    flex: 1;
  }

  .menu-toggle {
    display: flex;
  }

  header .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  header .nav-menu.is-open {
    display: flex;
  }

  header .nav-menu li {
    width: 100%;
  }

  header .nav-menu a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  header .nav-menu li:last-child a {
    border-bottom: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col h3 {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
  header .nav-menu {
    gap: 1.5rem;
  }

  header .logo {
    font-size: 1rem;
  }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.gallery picture {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.gallery picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery picture img:hover {
  transform: scale(1.05);
}

/* Contact Form */
.contact-form {
  max-width: 100%;
  margin: 2rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.form-group .required {
  color: #c62828;
  font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.2);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.btn-submit {
  background-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: inline-block;
}

.btn-submit:hover {
  background-color: #1e3d1a;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(45, 90, 39, 0.3);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(45, 90, 39, 0.2);
}

.form-note {
  font-size: 0.875rem;
  color: #666;
  margin-top: 1rem;
}

/* Form responsive */
@media (max-width: 768px) {
  .btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
