/*
Theme Name: FFW Wangen
Theme URI: https://example.com/ffw-wangen
Author: GitHub Copilot
Author URI: https://github.com/
Description: A custom WordPress theme for Freiwillige Feuerwehr Wangen.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ffw-wangen
*/

:root {
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --color-red: #d6001c;
  --color-dark: #333333;
  --color-gray: #666666;
  --color-light-gray: #f4f4f4;
  --color-donation-bg: #4a4a4a;
  --color-white: #ffffff;
}

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

body {
  font-family: var(--font-main);
  line-height: 1.5;
  color: var(--color-dark);
  background-color: var(--color-white);
}

/* Global Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-dark);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

a {
  color: var(--color-red);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

blockquote {
  border-left: 4px solid var(--color-red);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--color-gray);
}

/* Main Navigation */
.main-nav {
  background-color: var(--color-white);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-dark);
  gap: 15px;
}

.nav-logo-placeholder {
  width: 40px;
  height: 40px;
  background-color: #ccc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #666;
}

.nav-title {
  font-size: 1.25rem;
  font-weight: bold;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
  padding-left: 0;
  margin-bottom: 0;
}

.nav-menu li {
  margin-bottom: 0;
}

.nav-menu li a {
  color: var(--color-red);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.nav-menu li a:hover {
  color: var(--color-dark);
}

/* Hamburger Menu Logic */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: var(--color-red);
  height: 3px;
  width: 25px;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s ease-in-out;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: '';
  position: absolute;
}

.nav-toggle-label span::before {
  bottom: 8px;
}

.nav-toggle-label span::after {
  top: 8px;
}

/* Dropdown Menus */
.nav-menu li {
  position: relative;
}

.nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-white);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  min-width: 200px;
  padding: 10px 0;
  z-index: 1000;
  list-style: none;
}

.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu,
.nav-menu li.touch-open > .sub-menu {
  display: block;
}

.nav-menu .sub-menu li {
  display: block;
  margin: 0;
}

.nav-menu .sub-menu li a {
  display: block;
  padding: 8px 20px;
  white-space: nowrap;
  text-transform: none;
  font-weight: normal;
}

.nav-menu .sub-menu li a:hover {
  background-color: var(--color-light-gray);
  color: var(--color-red);
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
  .nav-toggle-label {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    box-shadow: 0 5px 5px rgba(0,0,0,0.1);
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
  }

  .nav-menu li a {
    display: block;
    padding: 15px;
    border-bottom: 1px solid #eee;
  }

  .nav-toggle:checked ~ .nav-menu {
    max-height: 100vh;
    overflow-y: auto;
  }

  /* Mobile Dropdown Overrides */
  .nav-menu li {
    position: static;
  }

  .nav-menu .sub-menu {
    position: static;
    display: block;
    box-shadow: none;
    padding: 0;
    background-color: #f9f9f9;
    width: 100%;
  }

  .nav-menu .sub-menu li a {
    padding-left: 30px;
    white-space: normal;
    border-bottom: 1px solid #eee;
  }
  
  /* Hamburger Animation */
  .nav-toggle:checked ~ .nav-toggle-label span {
    background: transparent;
  }
  
  .nav-toggle:checked ~ .nav-toggle-label span::before {
    bottom: 0;
    transform: rotate(45deg);
  }
  
  .nav-toggle:checked ~ .nav-toggle-label span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .nav-title {
    font-size: 1rem;
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Section */
.hero {
  position: relative;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background-color: #ddd;
}

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

.hero-ribbon {
  position: absolute;
  bottom: 150px;
  left: 10%;
  background-color: var(--color-red);
  color: var(--color-white);
  padding: 10px 30px;
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  transform: skewX(-15deg) rotate(-2deg);
  box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
}

.hero-ribbon span {
  display: block;
  transform: skewX(15deg); /* Counter-skew text */
}

@media (min-width: 2400px) {
  .hero {
    max-width: 2400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* News Section */
.news-section {
  padding: 60px 0;
}

.section-title {
  color: var(--color-red);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 30px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.news-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: start;
}

.news-content {
  min-width: 0; /* Prevents grid blowout */
}

.news-layout .news-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.news-sidebar .widget {
  margin-bottom: 30px;
  background: #f9f9f9;
  padding: 20px;
  border-radius: 4px;
}

.news-sidebar .widget-title {
  font-size: 1.2rem;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--color-red);
  padding-bottom: 10px;
}

.news-card {
  display: flex;
  flex-direction: column;
}

.news-thumb {
  width: 100%;
  height: 200px;
  background-color: #eee;
  object-fit: cover;
  margin-bottom: 15px;
}

.news-title {
  color: var(--color-red);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.3;
}

.news-date {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 10px;
}

.news-excerpt {
  font-size: 0.9rem;
  color: var(--color-gray);
}

/* Donation Section */
.donation-section {
  background-color: var(--color-donation-bg);
  color: var(--color-white);
  padding: 80px 0;
  margin: 60px 0 0 0;
}

.donation-content {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.donation-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.donation-subtitle {
  font-size: 1rem;
  margin-bottom: 50px;
  opacity: 0.9;
}

.donation-columns {
  display: flex;
  justify-content: space-between;
  text-align: left;
  margin-bottom: 60px;
}

.donation-col {
  flex: 1;
  padding: 0 20px;
  border-right: 1px solid rgba(255,255,255,0.2);
}

.donation-col:last-child {
  border-right: none;
}

.col-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.col-text {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.6;
}

.donation-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.btn {
  display: inline-block;
  padding: 15px 30px;
  background-color: var(--color-red);
  color: var(--color-white);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: #b00017;
}

/* Sidebar Stats Grid */
.sidebar-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  text-align: center;
}

.sidebar-stat-item {
  background: #fff;
  padding: 15px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sidebar-stat-item .stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-red);
  line-height: 1.2;
  display: block;
}

.sidebar-stat-item .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--color-gray);
  margin-top: 5px;
  display: block;
}

.stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-red);
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-red);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Footer */
.footer {
  background-color: #606060;
  color: var(--color-white);
  padding: 40px 0;
  position: relative;
}

.footer a {
  color: var(--color-white);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

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

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

.footer-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.emergency-box {
  background-color: var(--color-red);
  width: 100px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-white);
}

.address-block {
  font-size: 0.85rem;
  line-height: 1.6;
}

.address-block strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 5px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

/* Responsive */
@media (max-width: 900px) {
  .news-layout {
    grid-template-columns: 1fr;
  }
  
  .news-layout .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .news-layout .news-grid {
    grid-template-columns: 1fr;
  }
  
  .donation-columns {
    flex-direction: column;
    gap: 30px;
  }
  
  .donation-col {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 20px;
  }
  
  .donation-col:last-child {
    border-bottom: none;
  }
  
  .stats-grid {
    flex-wrap: wrap;
    gap: 30px;
  }
  
  .footer-grid {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }
  
  .footer-left {
    flex-direction: column;
  }
}
