/*
Theme Name: SDH Rasošky
Theme URI: https://sdhrasosky.cz
Author: SDH Rasošky
Author URI: https://sdhrasosky.cz
Description: Vlastní téma pro Sbor dobrovolných hasičů Rasošky. Čisté, přehledné a hasičsky červené.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sdh-rasosky
Tags: custom-menu, featured-images, responsive-layout, custom-logo
*/

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
  --red:        #C0392B;
  --red-dark:   #962d22;
  --red-light:  #e74c3c;
  --gold:       #D4A017;
  --white:      #ffffff;
  --off-white:  #f8f5f2;
  --gray-light: #f0ebe6;
  --gray:       #888;
  --text:       #1a1a1a;
  --text-muted: #555;
  --border:     #ddd;
  --radius:     6px;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);
  --max-width:  1200px;
  --font-body:  'Lato', 'Segoe UI', Arial, sans-serif;
  --font-head:  'Oswald', 'Arial Narrow', Arial, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; transition: color .2s; }
a:hover { color: var(--red-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: 1.2rem; margin-bottom: .5rem; }

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

/* =============================================
   LAYOUT HELPERS
   ============================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 4rem 0; }
.section--gray { background: var(--off-white); }
.section--red  { background: var(--red); color: var(--white); }
.section--red h2, .section--red h3 { color: var(--white); }
.section--red p  { color: rgba(255,255,255,.88); }

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 1rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--red);
  margin: .6rem auto 0;
  border-radius: 2px;
}
.section--red .section-title::after { background: var(--gold); }

/* =============================================
   HEADER & NAVBAR
   ============================================= */
.site-header {
  background: var(--red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
}

.site-branding img {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
}

.site-branding .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-branding .brand-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.site-branding .brand-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Navigation */
.main-nav { display: flex; align-items: center; gap: .2rem; }
.main-nav a {
  color: rgba(255,255,255,.9);
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .5rem .85rem;
  border-radius: var(--radius);
  transition: background .2s, color .2s;
}
.main-nav a:hover,
.main-nav .current_page_item > a,
.main-nav .current-menu-item > a {
  background: rgba(255,255,255,.18);
  color: var(--white);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,.5);
  color: var(--white);
  cursor: pointer;
  padding: .4rem .7rem;
  border-radius: var(--radius);
  font-size: 1.3rem;
  line-height: 1;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red) 60%, #8B1A1A 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.hero-logo img {
  height: 160px;
  width: auto;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
  flex-shrink: 0;
}
.hero-content { flex: 1; }
.hero-eyebrow {
  font-family: var(--font-head);
  font-size: .85rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .5rem;
}
.hero h1 { color: var(--white); margin-bottom: .6rem; }
.hero-subtitle { font-size: 1.15rem; color: rgba(255,255,255,.85); margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-block;
  padding: .7rem 1.6rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary   { background: var(--white); color: var(--red); border-color: var(--white); }
.btn-primary:hover { background: var(--off-white); color: var(--red-dark); }

.btn-outline   { background: transparent; color: var(--white); border-color: rgba(255,255,255,.7); }
.btn-outline:hover { background: rgba(255,255,255,.15); color: var(--white); border-color: var(--white); }

.btn-red       { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }

/* =============================================
   STAT CARDS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.8rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--red);
}
.stat-number {
  font-family: var(--font-head);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-label { color: var(--text-muted); font-size: .9rem; }

/* =============================================
   FEATURE CARDS
   ============================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--red);
  transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.feature-icon { font-size: 2.5rem; margin-bottom: .8rem; }
.feature-card h3 { color: var(--red); margin-bottom: .5rem; }

/* =============================================
   POSTS / AKTUALITY
   ============================================= */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.post-card-thumb { aspect-ratio: 16/9; overflow: hidden; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-thumb.no-thumb {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}

.post-card-body { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }
.post-meta { font-size: .8rem; color: var(--gray); margin-bottom: .5rem; }
.post-card-body h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.post-card-body h3 a { color: var(--text); }
.post-card-body h3 a:hover { color: var(--red); }
.post-excerpt { font-size: .9rem; color: var(--text-muted); flex: 1; margin-bottom: 1rem; }
.read-more { font-size: .85rem; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .04em; }
.read-more:hover { color: var(--red-dark); }

/* =============================================
   SINGLE POST
   ============================================= */
.page-header {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}
.page-header h1 { color: var(--white); }
.page-header .page-meta { color: rgba(255,255,255,.75); font-size: .9rem; margin-top: .5rem; }

.entry-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.entry-content h2,
.entry-content h3 { margin-top: 2rem; margin-bottom: .75rem; }
.entry-content figure { margin: 1.5rem 0; }
.entry-content figure img { border-radius: var(--radius); }
.entry-content blockquote {
  border-left: 4px solid var(--red);
  padding: .75rem 1.25rem;
  background: var(--off-white);
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.entry-content th { background: var(--red); color: var(--white); padding: .6rem 1rem; text-align: left; }
.entry-content td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.entry-content tr:nth-child(even) td { background: var(--off-white); }

/* =============================================
   SIDEBAR & WIDGETS
   ============================================= */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.widget { margin-bottom: 2rem; }
.widget-title {
  font-family: var(--font-head);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--red);
  margin-bottom: 1rem;
}
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a:hover { color: var(--red); }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin: 3rem 0 1rem;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  display: inline-block;
  padding: .5rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  transition: background .2s, color .2s;
}
.pagination .page-numbers:hover,
.pagination .current {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* =============================================
   CTA BANNER
   ============================================= */
.cta-banner {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: var(--white);
  text-align: center;
  padding: 3.5rem 1.5rem;
}
.cta-banner h2 { color: var(--white); margin-bottom: .5rem; }
.cta-banner p { color: rgba(255,255,255,.85); margin-bottom: 1.5rem; font-size: 1.05rem; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,.7);
  padding: 3rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer-col h4 {
  font-family: var(--font-head);
  color: var(--white);
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--red);
  display: inline-block;
}
.footer-col p,
.footer-col a { font-size: .88rem; color: rgba(255,255,255,.65); }
.footer-col a:hover { color: var(--gold); }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-brand img { height: 56px; margin-bottom: .75rem; filter: brightness(0) invert(1) opacity(.8); }
.footer-brand .brand-name { color: var(--white); font-family: var(--font-head); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.2rem 0;
  text-align: center;
  font-size: .82rem;
  color: rgba(255,255,255,.4);
}
.footer-bottom a { color: rgba(255,255,255,.4); }
.footer-bottom a:hover { color: var(--gold); }

/* =============================================
   WORDPRESS CORE
   ============================================= */
.wp-caption { max-width: 100%; }
.wp-caption-text { text-align: center; font-size: .85rem; color: var(--gray); margin-top: .3rem; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1rem auto; }
.wp-block-image { margin: 1.5rem 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; margin: 1.5rem 0; }
.gallery-item { margin: 0; overflow: hidden; border-radius: var(--radius); }
.gallery-item img { width: 100%; height: 180px; object-fit: cover; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.07); }

/* Screen reader text */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero-inner { flex-direction: column; text-align: center; gap: 1.5rem; }
  .hero-logo img { height: 110px; }
  .hero-buttons { justify-content: center; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0; right: 0;
    background: var(--red-dark);
    padding: 1rem;
    gap: .2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
  }
  .main-nav.open { display: flex; }
  .main-nav a { display: block; padding: .65rem 1rem; border-radius: var(--radius); }
  .site-header { position: relative; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* =============================================
   DETAIL AKCE SDH (single-sdh_akce.php)
   ============================================= */
.sdh-akce-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5rem;
    align-items: start;
}

.sdh-akce-thumb {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
}
.sdh-akce-thumb img { width: 100%; height: auto; display: block; }

.sdh-akce-popis { margin-bottom: 0; }

.sdh-akce-formular { margin-top: 2rem; }

/* Info box v postranním panelu */
.sdh-akce-info-box {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--red);
    border-radius: var(--radius);
    padding: 1.4rem;
}

/* Breadcrumb zpět na kalendář */
.sdh-akce-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-head);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    background: rgba(255,255,255,.12);
    padding: .45rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.15);
    transition: background .2s, color .2s, border-color .2s;
    margin-bottom: .75rem;
}
.sdh-akce-breadcrumb:hover {
    background: rgba(255,255,255,.22);
    color: #fff;
    border-color: rgba(255,255,255,.3);
}
.sdh-akce-breadcrumb svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.sdh-akce-info-title {
    font-family: var(--font-head);
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--red);
    margin: 0 0 1.1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
}

.sdh-akce-info-row {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    line-height: 1.45;
}
.sdh-akce-info-row:last-of-type { border-bottom: none; }

.sdh-akce-info-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.sdh-akce-kapacita-bar {
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}
.sdh-akce-kapacita-fill {
    height: 100%;
    background: var(--red);
    border-radius: 3px;
    transition: width .4s;
}

@media (max-width: 768px) {
    .sdh-akce-layout {
        grid-template-columns: 1fr;
    }

    /* Na mobilu dáme sidebar nahoru */
    .sdh-akce-sidebar { order: -1; }
}
