/*
Theme Name: DSG 1857 Modern Theme
Theme URI: https://www.dsg1857.de/
Author: Antigravity
Author URI: https://gemini.google.com/
Description: A modern, high-performance, dark-theme website for Dudweiler Schützengesellschaft 1857 e.V.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dsg1857
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   1. Design System & CSS Variables
   ========================================================================== */
:root {
  --bg-primary: #0b0c10;
  --bg-secondary: #1f2833;
  --bg-card: rgba(31, 40, 51, 0.45);
  --bg-card-hover: rgba(31, 40, 51, 0.7);
  
  --accent-gold: #c5a01a;
  --accent-gold-hover: #e7bb1d;
  --accent-gold-glow: rgba(197, 160, 26, 0.25);
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(197, 160, 26, 0.3);
  
  --text-primary: #f5f6f8;
  --text-secondary: #c5c6c7;
  --text-muted: #858688;
  
  --font-headings: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --header-height: 100px;
  --header-height-shrunk: 70px;
  --border-radius: 12px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-gold: 0 8px 32px 0 rgba(197, 160, 26, 0.15);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); margin-bottom: 1rem; }
h4 { font-size: 1.15rem; margin-bottom: 0.5rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 300;
}

p.lead {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-primary);
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: var(--transition-smooth);
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   3. Layout & Navigation Header
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition-smooth);
  background-color: rgba(11, 12, 16, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
}

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

.logo-wrapper {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 48px;
  width: auto;
  transition: var(--transition-smooth);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-item {
  position: relative;
  font-family: var(--font-headings);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
}

.nav-item:hover, .nav-item.active {
  color: var(--accent-gold-hover);
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-gold);
  transition: var(--transition-smooth);
}

.nav-item:hover::after, .nav-item.active::after {
  width: 100%;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 1001;
}

/* Shrinking Header Animation on Scroll (Native support check) */
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  @keyframes shrink-header {
    to {
      height: var(--header-height-shrunk);
      background-color: rgba(11, 12, 16, 0.9);
      box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    }
  }
  @keyframes shrink-logo {
    to {
      height: 38px;
    }
  }
  header {
    animation: shrink-header auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 100px;
  }
  .logo-img {
    animation: shrink-logo auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 100px;
  }
}

/* Class-based fallback applied by JS */
header.header-shrunk {
  height: var(--header-height-shrunk);
  background-color: rgba(11, 12, 16, 0.9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
header.header-shrunk .logo-img {
  height: 38px;
}

/* ==========================================================================
   4. Common Components & Layouts
   ========================================================================== */
.section {
  padding: 8rem 0 6rem;
  position: relative;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  align-items: center;
}

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

.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--border-radius);
  transition: var(--transition-smooth);
  cursor: pointer;
  gap: 0.5rem;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: var(--accent-gold-hover);
  color: var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-gold-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-gold-hover);
  color: var(--accent-gold-hover);
  transform: translateY(-2px);
}

/* Block Editor: bridge core/button to .btn-primary visual (transition + hover-transform). theme.json styles.elements.button (theme.json) handles the rest. */
.wp-element-button, .wp-block-button__link {
  transition: var(--transition-smooth);
}

.wp-element-button:hover, .wp-block-button__link:hover {
  transform: translateY(-2px);
}

/* Glassmorphism Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 2.2rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  box-shadow: var(--shadow-gold), var(--shadow-card);
}

.card:hover::before {
  opacity: 1;
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--border-radius) - 4px);
  margin-bottom: 1.5rem;
  aspect-ratio: 16/10;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--accent-gold);
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
}

/* Info List (Mitglied werden / Einweisung) */
.info-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step-num {
  font-family: var(--font-headings);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
  background-color: rgba(197, 160, 26, 0.1);
  border: 1px solid var(--border-glass);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-text h4 {
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.step-text p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* ==========================================================================
   5. Hero Section (Home)
   ========================================================================== */
.hero {
  height: 90vh;
  min-height: 650px;
  display: flex;
  align-items: center;
  position: relative;
  background-image: linear-gradient(180deg, rgba(11, 12, 16, 0.3) 0%, rgba(11, 12, 16, 0.85) 100%), 
                    url('../assets/arms-blur-close-up-370202-7a5dc6e8-2880w.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding-top: 100px;
}

.hero-content {
  max-width: 700px;
  z-index: 10;
}

.hero-subtitle {
  font-family: var(--font-headings);
  color: var(--accent-gold);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.hero h1 {
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.hero p {
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   6. Table & Opening Hours (Leistungen)
   ========================================================================== */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin-top: 2rem;
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 600px;
}

th, td {
  padding: 1.2rem 1.5rem;
}

th {
  font-family: var(--font-headings);
  font-weight: 600;
  color: var(--accent-gold);
  border-bottom: 1px solid var(--border-glass);
  background-color: rgba(11, 12, 16, 0.4);
}

td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

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

tr:hover td {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
}

.badge-info {
  background-color: rgba(197, 160, 26, 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(197, 160, 26, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-danger {
  background-color: rgba(220, 38, 38, 0.1);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ==========================================================================
   7. Gallery (Bilder)
   ========================================================================== */
.gallery-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-headings);
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-btn.active, .filter-btn:hover {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-glass);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(11, 12, 16, 0.1) 40%, rgba(11, 12, 16, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: var(--transition-smooth);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-title {
  color: var(--text-primary);
  font-family: var(--font-headings);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gallery-category {
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 10, 12, 0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-content-wrapper {
  position: relative;
  max-width: 90%;
  max-height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  border: 1px solid var(--border-glass);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lightbox-close:hover {
  color: var(--accent-gold);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(31, 40, 51, 0.5);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  transition: var(--transition-smooth);
  backdrop-filter: blur(4px);
}

.lightbox-nav:hover {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-caption {
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-family: var(--font-headings);
  font-size: 1.2rem;
  text-align: center;
}

/* ==========================================================================
   8. Scroll Animations (View Timeline)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes fade-slide-up {
      from {
        opacity: 0;
        transform: translateY(40px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    .scroll-reveal {
      animation: fade-slide-up auto linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

/* CSS transition reveal for browsers that do not support view() timelines (paired with JS) */
.js-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
footer {
  background-color: #07080a;
  border-top: 1px solid var(--border-glass);
  padding: 5rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-col h3 {
  color: var(--accent-gold);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.footer-col p {
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--accent-gold-hover);
  padding-left: 5px;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.social-icon {
  background-color: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  color: var(--text-muted);
}

.footer-bottom-links a:hover {
  color: var(--text-secondary);
}

/* ==========================================================================
   10. Media Queries (Responsiveness)
   ========================================================================== */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 80px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: rgba(11, 12, 16, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: calc(100vh - var(--header-height));
    flex-direction: column;
    padding: 3rem 0;
    gap: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    border-bottom: 1px solid var(--border-glass);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  
  .nav-item {
    font-size: 1.25rem;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .hero {
    height: auto;
    padding: 8rem 0 6rem;
    background-attachment: scroll;
  }
  
  .hero-btns {
    flex-direction: column;
  }
  
  .hero-btns .btn {
    width: 100%;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
