/*
Theme Name: SV Humlikon-Adlikon
Theme URI: https://www.sv-humlikon-adlikon.ch
Author: SV Humlikon-Adlikon
Author URI: https://www.sv-humlikon-adlikon.ch
Description: Custom WordPress theme for SV Humlikon-Adlikon shooting club. Based on the air-light starter theme with responsive design replicating the current website layout.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: MIT License
License URI: https://opensource.org/licenses/MIT
Text Domain: sv-humlikon-adlikon-air
Tags: one-column, responsive-layout, custom-logo, featured-images, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.
*/

/* Custom styles for SV Humlikon-Adlikon */

:root {
  /* Primary color palette - ENHANCED */
  --sv-primary-blue: #0080C0;
  --sv-heading-green: #2d6a2d;  /* Deeper green for better contrast */
  --sv-nav-bg-start: #7cb87c;    /* Gradient start */
  --sv-nav-bg-end: #6fa86f;      /* Gradient end */
  --sv-nav-text: #fff8dc;
  --sv-nav-hover-bg: rgba(255, 255, 255, 0.25);
  --sv-nav-hover-text: #261;
  --sv-border-gray: #708090;
  --sv-footer-text: #666;
  --sv-footer-bg: #f8f8f8;
  --sv-sidebar-bg: #f8faf8;      /* Warm white for sidebar */

  /* Typography - MODERNIZED */
  --sv-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                    'Helvetica Neue', Arial, sans-serif;
  --sv-container-width: 1400px;

  /* Spacing - ADJUSTED */
  --sv-content-width: 900px;
  --sv-sidebar-width: 400px;
}

/* Base reset with modern typography */
body {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--sv-font-family);
  font-size: 16px;  /* Increased from 14px for better readability */
  line-height: 1.7; /* Increased for better readability */
  background-attachment: scroll;
  background-color: #FFFFFF;
}

/* Align header to top - remove all spacing */
#page {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.site-header {
  margin-top: 0;
  padding-top: 0;
}

#container,
#masthead,
#navigation,
#content,
#sidebar,
#footer {
  margin: 0;
  padding: 0;
  border: 0;
}

.float-right {
  float: right;
}

/* Masthead styling */
#masthead h1 {
  font-weight: normal;
  color: #261;
  text-transform: uppercase;
  display: inline;
}

#masthead img {
  max-width: 100%;
  height: auto;
}

/* Site Header - Enhanced spacing */
.site-header {
  background: #fff;
  border: none;
  margin: 0;
  padding: 30px 0 0 0;
  text-align: center;
}

.site-header-inner {
  width: 100%;
  max-width: var(--sv-container-width);
  margin: 0 auto;
  padding: 0 20px;
  background: transparent;
  border: none;
  box-sizing: border-box;
  text-align: center;
}

/* Site Branding & Logo - Centered */
.site-branding {
  text-align: center;
  margin: 0 0 20px 0;  /* Added bottom margin */
  padding: 0;
  background: transparent;
  border: none;
}

.site-branding .site-logo {
  margin: 0;
  padding: 0;
  text-align: center;
  background: transparent;
  border: none;
}

.site-branding .site-logo a {
  display: inline-block;
  background: transparent;
  border: none;
  text-decoration: none;
}

.site-branding .site-logo img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: auto;
  height: auto;
  background: transparent;
  border: none;
}

/* Remove white backgrounds from main content areas */
.site-content,
#page,
.site-main,
#primary,
#container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Remove background from articles and posts */
article,
.post,
.page,
.entry-content {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Navigation styling - MODERNIZED with gradient */
#navigation {
  width: 100%;
  max-width: var(--sv-container-width);
  margin-right: auto;
  margin-left: auto;
  clear: both;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sv-nav-bg-start) 0%, var(--sv-nav-bg-end) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 12px 40px;
  box-sizing: border-box;
}

#navigation ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;  /* Centered menu */
}

#navigation li {
  margin: 0 3px;
}

#navigation a {
  text-decoration: none;
  color: var(--sv-nav-text);
  display: block;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 16px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

#navigation a:hover {
  text-decoration: none;
  color: var(--sv-nav-text);
  background-color: var(--sv-nav-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Main container - WIDER */
#container {
  width: 100%;
  max-width: var(--sv-container-width);
  margin: 0 auto;
  background-color: #fff;
}

#page_content {
  position: relative;
  width: 100%;
  max-width: var(--sv-container-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 40px;  /* Added side padding */
  box-sizing: border-box;
  overflow: hidden;  /* Clear floats */
}

/* Single-column full-width layout */
.content-area {
  float: none;
  width: 100%;
  max-width: 100%;
}

#content {
  text-align: left;
  padding-top: 20px;   /* Increased from 5px */
  padding-bottom: 20px;
}

#content h1,
#content h2,
#content h3,
#content h4,
#content h5,
#content h6 {
  color: var(--sv-heading-green);
  font-weight: 600;    /* Semibold for better hierarchy */
}

#content h1 {
  font-size: 32px;     /* Increased from default */
}

#content h2 {
  font-size: 26px;
}

#content h3 {
  font-size: 22px;
}

#content img {
  padding: 5px;
}

#content p {
  color: #333;         /* Softer than pure black */
  margin-bottom: 1.2em;
  line-height: 1.7;
}

#content a {
  color: var(--sv-primary-blue);
  text-decoration: none;
  font-size: inherit;
  transition: opacity 0.2s ease;
}

#content a:hover {
  opacity: 0.7;
  text-decoration: none;
}

/* File download elements - ensure same font size as paragraph */
#content .sdm_download_item,
#content .sdm_download_link,
#content .wpdm-download-link,
#content .download-link,
#content a[href$=".pdf"],
#content a[href$=".doc"],
#content a[href$=".docx"],
#content a[href$=".xls"],
#content a[href$=".xlsx"] {
  font-size: 16px;
  line-height: 1.7;
}

/* Footer - CENTERED AND MODERNIZED */
#footer,
.site-footer,
#colophon {
  clear: both;
  width: 100%;
  max-width: var(--sv-container-width);
  margin-right: auto;
  margin-left: auto;
  padding: 40px;
  background-color: var(--sv-footer-bg);
  border-top: 1px solid #e0e0e0;
  text-align: center;  /* Centered */
  box-sizing: border-box;
}

#footer p {
  font-size: 14px;  /* Increased from 0.85em (~12px) */
  color: var(--sv-footer-text);
  margin: 0;
}

#footer a,
.site-footer a {
  color: var(--sv-border-gray);
  text-decoration: underline;
  transition: color 0.3s ease;
}

#footer a:hover,
.site-footer a:hover {
  color: #2d6a2d;  /* Match heading green */
  text-decoration: none;
}

/* Partner logos in footer - CENTERED */
.partner-logos {
  margin-bottom: 25px;
}

.partner-logos .partner-list {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;  /* Centered */
  gap: 40px;
}

.partner-logos .partner-list li {
  margin: 0;
}

.partner-logos .partner-list li a {
  display: block;
  text-decoration: none;
}

.partner-logos .partner-list li a img {
  display: block;
  height: 60px;  /* Increased from variable */
  width: auto;
  max-width: 100%;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.partner-logos .partner-list li a:hover img {
  opacity: 1;
}

/* Site info / copyright */
.site-info {
  text-align: center;
  margin-top: 10px;
}

.site-info p {
  margin: 0;
}

/* Footer container */
.site-footer .container {
  width: 100%;
  max-width: var(--sv-container-width);
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

/* General link styling */
a {
  color: var(--sv-primary-blue);
  text-decoration: underline;
}

a:hover {
  color: var(--sv-border-gray);
  text-decoration: underline;
}

/* Utility classes */
.style-bold {
  font-weight: bold;
}

.style-italic {
  font-style: italic;
}

.text-center {
  text-align: center;
}

/* HR dividers */
hr {
  border: none;
  height: 1px;
  background-color: #ccc;
  margin: 20px 0;
}

/* PDF links styling */
.pdf-links li {
  margin-bottom: 15px;
}

.pdf-links img {
  vertical-align: middle;
  margin-right: 5px;
}

/* Hamburger Menu Styles */
.nav-primary {
  position: relative;
}

/* Hamburger Icon */
.hamburger {
  --hamburger-layer-height: 2px;
  --hamburger-width: 1.5rem;
  --hamburger-color: var(--sv-nav-text);
  --hamburger-color-active: var(--sv-nav-text);
  background-color: var(--hamburger-color);
  flex-shrink: 0;
  height: var(--hamburger-layer-height);
  position: relative;
  transition: all 0.2s ease 0s;
  width: var(--hamburger-width);
  display: none;
}

.hamburger::before,
.hamburger::after {
  background-color: var(--hamburger-color);
  content: '';
  display: block;
  height: var(--hamburger-layer-height);
  position: absolute;
  transition: all 0.2s ease 0s;
  width: var(--hamburger-width);
}

.hamburger::before {
  top: -0.375rem;
}

.hamburger::after {
  bottom: -0.375rem;
}

/* Nav Toggle Button */
.nav-toggle {
  align-items: center;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  display: none;
  font-weight: 600;
  height: 2.5rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  user-select: none;
  width: 2.5rem;
  z-index: 100;
}

.nav-toggle:hover {
  background-color: var(--sv-nav-hover-bg);
}

.nav-toggle:focus {
  outline: 2px solid var(--sv-nav-text);
  outline-offset: 2px;
}

/* Active hamburger state (X) */
.js-nav-active .hamburger::before,
.js-nav-active .hamburger::after {
  background-color: var(--hamburger-color-active);
  left: 0;
  top: 0;
}

.js-nav-active .hamburger::before {
  transform: rotate(-45deg);
}

.js-nav-active .hamburger::after {
  transform: rotate(45deg);
}

.js-nav-active .hamburger {
  background-color: transparent;
}

/* Mobile Menu Panel */
.menu-items-wrapper {
  width: 100%;
}

/* Responsive breakpoints - IMPROVED */
@media (max-width: 767px) {
  #page_content {
    padding: 0 20px;  /* Reduced padding on mobile */
  }

  #navigation {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 60px;
  }

  /* Show hamburger button on mobile */
  .nav-toggle {
    display: flex;
    position: relative;
    right: 0;
    top: 0;
    transform: none;
    margin: 0 0 0 auto;
    height: 3rem;
    width: 3rem;
    padding: 0.5rem;
  }

  .nav-toggle .hamburger {
    display: block;
  }

  /* Mobile menu panel */
  .menu-items-wrapper {
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    height: calc(100vh - 100px);
    background: linear-gradient(135deg, var(--sv-nav-bg-start) 0%, var(--sv-nav-bg-end) 100%);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.3s ease-in-out;
    visibility: hidden;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    z-index: 99;
  }

  /* Show menu when active */
  .js-nav-active .menu-items-wrapper {
    transform: translate3d(0, 0, 0);
    visibility: visible;
  }

  #navigation ul {
    justify-content: center;
    flex-direction: column;
    margin: 0;
    padding: 0;
  }

  #navigation li {
    width: 100%;
    margin: 3px 0;
  }

  #navigation a {
    padding: 12px 20px;  /* Larger touch targets (44px min) */
    font-size: 16px;
    text-align: center;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  #content {
    padding: 20px;
  }

  .site-header-inner {
    padding: 0 20px;
  }

  .site-branding {
    padding: 20px 0 10px;
  }

  #footer,
  .site-footer,
  #colophon {
    padding: 30px 20px;
  }

  .partner-logos .partner-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    justify-items: center;
  }

  .partner-logos .partner-list li a img {
    height: 50px;
  }
}

@media (min-width: 768px) and (max-width: 1200px) {
  #page_content {
    padding: 0 30px;
  }

  #content {
    padding: 20px 0;
  }

  #navigation a {
    padding: 10px 16px;
    font-size: 15px;
  }

  #footer,
  .site-footer,
  #colophon {
    padding: 30px;
  }
}

@media (min-width: 1200px) {
  #page_content {
    padding: 0 40px;
  }

  #content {
    padding: 20px 0;
  }
  .content-area.full-width {
    width: 100%;
    max-width: 100%;
  }

  .content-area.full-width #content {
    width: 100%;
    max-width: 100%;
  }

  .sidebar {
    width: 400px;
    float: right;
    margin-left: 40px;
  }
}

/* Accessibility - Skip to content */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999999;
}

.skip-link:focus {
  left: 6px;
  top: 7px;
  background-color: #fff;
  color: #000;
  padding: 8px;
  text-decoration: none;
}

/* Print styles */
@media print {
  #navigation,
  .skip-link {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* FileBird Plugin Compatibility */
/* Ensure FileBird media library folders display correctly */
.post-type-attachment .wp-filter {
  margin: 0 0 20px 0;
}

/* FileBird sidebar in media library */
.filebird-sidebar {
  background: #f0f0f1;
  border-right: 1px solid #c3c4c7;
}

/* FileBird folder tree items */
.filebird-tree li {
  margin: 0;
  padding: 0;
}

/* Ensure FileBird doesn't conflict with theme layout */
.media-modal {
  z-index: 160000;
}

/* Fix FileBird modal in customizer */
.wp-customizer .media-modal {
  z-index: 560000;
}
