/*
Theme Name: KÄRNTEN FUNKT
Theme URI: https://ktnfunkt.oeradio.at
Description: Custom theme for KÄRNTEN FUNKT - Amateurfunk, CB-Funk und PMR in Kärnten
Version: 1.0.0
Author: KÄRNTEN FUNKT
Text Domain: kaernten-funkt
*/

/* ===== Self-hosted Inter font ===== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/inter-400.woff2') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/inter-500.woff2') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/inter-700.woff2') format('truetype');
}

/* ===== CSS Variables ===== */
:root {
  --color-primary: #3d4f2f;
  --color-primary-light: #556b3e;
  --color-primary-dark: #2a3520;
  --color-secondary: #c53030;
  --color-secondary-light: #e53e3e;
  --color-accent: #b8860b;
  --color-accent-light: #d4a017;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5ec;
  --color-text: #2f3529;
  --color-text-light: #6b7c5e;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Utilities ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 896px; margin: 0 auto; padding: 0 1rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }

.section { padding: 4rem 0; }
.section-lg { padding: 5rem 0; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-5 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
  .section { padding: 4rem 0; }
  .section-lg { padding: 8rem 0; }
}
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ===== Typography ===== */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.25rem; }

@media (min-width: 768px) {
  h1 { font-size: 3.75rem; }
}

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-4xl { font-size: 2.25rem; }

.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-secondary { color: var(--color-secondary); }
.text-light { color: var(--color-text-light); }
.text-white { color: #fff; }
.text-white-80 { color: rgba(255,255,255,0.8); }
.text-white-60 { color: rgba(255,255,255,0.6); }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }

/* ===== Backgrounds ===== */
.bg-primary { background-color: var(--color-primary); }
.bg-primary-dark { background-color: var(--color-primary-dark); }
.bg-alt { background-color: var(--color-bg-alt); }
.bg-white { background-color: #fff; }

.bg-hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light), var(--color-primary));
  color: #fff;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  font-size: 1.125rem;
  cursor: pointer;
  border: none;
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-primary-dark);
}
.btn-accent:hover { background-color: var(--color-accent-light); }

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

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

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}
@media (min-width: 640px) {
  .btn-group { flex-direction: row; }
}

/* ===== Cards ===== */
.card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  padding: 2rem;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

.card-bordered {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.card-bordered:hover { border-color: rgba(61,79,47,0.3); }

.card-glass {
  background: rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

/* ===== Pillar Icons ===== */
.pillar-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}
.pillar-icon-red { background: rgba(197,48,48,0.1); color: var(--color-secondary); }
.pillar-icon-amber { background: rgba(184,134,11,0.1); color: var(--color-accent); }
.pillar-icon-green { background: #dcfce7; color: #15803d; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}
.badge-red { background: rgba(197,48,48,0.1); color: var(--color-secondary); }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-accent { color: var(--color-accent); font-weight: 500; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff;
}

.header-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.header-brand-text { display: none; }
@media (min-width: 640px) { .header-brand-text { display: inline; } }

.header-nav { display: none; }
@media (min-width: 1024px) {
  .header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
}

.header-nav a {
  color: rgba(255,255,255,0.8);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.header-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.header-nav a.active { background: rgba(255,255,255,0.2); color: #fff; }
.header-nav a.nav-cta { background: var(--color-accent); color: var(--color-primary-dark); font-weight: 700; }
.header-nav a.nav-cta:hover { background: var(--color-accent-light); color: var(--color-primary-dark); }
.mobile-nav a.nav-cta { background: var(--color-accent); color: var(--color-primary-dark); font-weight: 700; border-radius: 0.375rem; padding: 0.5rem 1rem; display: inline-block; }
.mobile-nav a.nav-cta:hover { background: var(--color-accent-light); }

/* Mobile menu */
.mobile-toggle {
  display: flex;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}
@media (min-width: 1024px) { .mobile-toggle { display: none; } }

.mobile-nav {
  display: none;
  background: var(--color-primary);
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block;
  color: rgba(255,255,255,0.8);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ===== Footer ===== */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.footer-logo { width: 1.5rem; height: 1.5rem; border-radius: 50%; }

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.6);
  padding: 0.25rem 0;
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.4);
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: #fff; }

/* ===== Hero Section ===== */
.hero-logo {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 15px rgba(0,0,0,0.2);
  border: 4px solid var(--color-accent);
}

/* ===== Klubstation highlight ===== */
.klubstation-teaser {
  background: rgba(61,79,47,0.05);
  border-radius: 0.75rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .klubstation-teaser { flex-direction: row; }
}

/* ===== Link arrows ===== */
.link-arrow {
  color: var(--color-primary);
  font-weight: 500;
  transition: color 0.2s;
}
.link-arrow:hover { color: var(--color-primary-light); }

/* ===== Stats ===== */
.stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary);
}
.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
}

/* ===== WordPress specifics ===== */
.entry-content h2 { margin: 2rem 0 1rem; }
.entry-content h3 { margin: 1.5rem 0 0.75rem; }
.entry-content p { margin-bottom: 1rem; color: var(--color-text-light); }
.entry-content ul, .entry-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.entry-content li { margin-bottom: 0.5rem; color: var(--color-text-light); }
.entry-content a { color: var(--color-primary); text-decoration: underline; }
.entry-content img { border-radius: 0.75rem; margin: 1.5rem 0; }

/* Leaflet map z-index fix — isolate stacking context so Leaflet's internal
   z-index values (400+) don't escape and overlap the sticky header (z-index:50) */
.map-wrapper { position: relative; z-index: 1; isolation: isolate; }

/* WordPress admin bar fix */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

/* Mobile image optimization */
img { content-visibility: auto; }
img[loading="lazy"] { content-visibility: auto; }

/* Alignment classes */
.alignwide { max-width: 1280px; margin: 0 auto; }
.alignfull { width: 100%; max-width: 100%; }
.aligncenter { text-align: center; }

/* ===== Page template sections ===== */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light), var(--color-primary));
  color: #fff;
  padding: 5rem 0;
  text-align: center;
}
.page-hero h1 { margin-bottom: 1rem; }
.page-hero p { color: rgba(255,255,255,0.8); font-size: 1.125rem; }
