/*
Theme Name: Vojenský Obor FTVS UK
Theme URI: https://vojenskyobor.cz
Author: FTVS UK — Vojenský obor
Description: Téma pro web Vojenské tělovýchovy FTVS UK. Vojenský styl, navy + gold paleta, Barlow Condensed font.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: vojenskyobor
*/

/* ═══════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
═══════════════════════════════════════════════ */
:root {
  --navy:   #0d1f3c;
  --navy2:  #152b52;
  --blue:   #1a4fa0;
  --blue2:  #2563c4;
  --olive:  #4a5e2f;
  --olive2: #6b8640;
  --gold:   #c8a84b;
  --light:  #f4f6fa;
  --white:  #fff;
  --text:   #1e2533;
  --muted:  #64748b;
  --border: #dde2ec;
  --fh: 'Barlow Condensed', sans-serif;
  --fb: 'Barlow', sans-serif;
  --r:  6px;
  --sh:  0 4px 20px rgba(13,31,60,.10);
  --sh2: 0 8px 32px rgba(13,31,60,.14);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--fb);
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue2); }

/* ═══════════════════════════════════════════════
   LAYOUT CONTAINERS
═══════════════════════════════════════════════ */
.container,
.wp-block-group.is-layout-constrained > *,
.entry-content > * {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ═══════════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--fh);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--navy);
  line-height: 1.1;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1rem; }
.section-label {
  font-family: var(--fh);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--olive2);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--olive2);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════ */
.site-topbar {
  background: var(--navy);
  color: rgba(255,255,255,.6);
  font-size: .78rem;
  padding: 6px 0;
}
.site-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-topbar a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  margin-left: 1.2rem;
  transition: .2s;
}
.site-topbar a:hover { color: var(--gold); }

/* ═══════════════════════════════════════════════
   HEADER & NAVIGATION
═══════════════════════════════════════════════ */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--blue);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--sh);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 70px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo img { height: 52px; width: auto; }
.site-logo .logo-text strong {
  display: block;
  font-family: var(--fh);
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.site-logo .logo-text span {
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .03em;
}

/* Primary Navigation */
.primary-navigation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.primary-navigation ul {
  list-style: none;
  display: flex;
  gap: 0;
  align-items: center;
}
.primary-navigation li { position: relative; }
.primary-navigation li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 .85rem;
  height: 70px;
  font-family: var(--fh);
  font-weight: 600;
  font-size: .86rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: .2s;
  white-space: nowrap;
}
.primary-navigation li > a:hover,
.primary-navigation li.current-menu-item > a,
.primary-navigation li.current-menu-ancestor > a {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Dropdown submenu */
.primary-navigation .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 230px;
  box-shadow: var(--sh2);
  border-top: 3px solid var(--blue);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: .2s;
  z-index: 200;
  list-style: none;
}
.primary-navigation li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.primary-navigation .sub-menu a {
  display: block;
  padding: .65rem 1.2rem;
  height: auto;
  font-size: .84rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-bottom: none;
  margin-bottom: 0;
  transition: .15s;
}
.primary-navigation .sub-menu a:hover {
  background: var(--light);
  border-left-color: var(--olive2);
  color: var(--navy);
}
/* Third-level submenu */
.primary-navigation .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  border-top: none;
  border-left: 3px solid var(--blue);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  margin-left: auto;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: .3s;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn, .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 26px;
  border-radius: var(--r);
  font-family: var(--fh);
  font-weight: 700;
  font-size: .92rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  border: 2px solid transparent;
  transition: .2s;
  cursor: pointer;
}
.btn-primary, .wp-block-button.is-style-primary .wp-block-button__link {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue2); border-color: var(--blue2); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-secondary:hover { background: var(--blue); color: #fff; }
.btn-gold, .wp-block-button.is-style-gold .wp-block-button__link {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-gold:hover { background: #d4b560; border-color: #d4b560; }

/* ═══════════════════════════════════════════════
   PAGE HERO (stránkový banner)
═══════════════════════════════════════════════ */
.page-hero {
  background: var(--navy);
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--gold), var(--olive2));
}
.page-hero .breadcrumb {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin-bottom: .8rem;
}
.page-hero .breadcrumb a { color: rgba(255,255,255,.5); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: var(--gold); }
.page-hero .section-label { color: var(--gold); }
.page-hero .section-label::before { background: var(--gold); }
.page-hero h1 { color: #fff; margin-bottom: .8rem; }
.page-hero .page-hero-desc { color: rgba(255,255,255,.7); font-size: 1rem; max-width: 640px; }

/* ═══════════════════════════════════════════════
   PAGE CONTENT LAYOUT
═══════════════════════════════════════════════ */
.page-content { padding: 3rem 0; }
.page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.main-col {}
.sidebar {}

/* ═══════════════════════════════════════════════
   ENTRY CONTENT (Gutenberg styles)
═══════════════════════════════════════════════ */
.entry-content h2 { margin: 2rem 0 1rem; font-size: 1.4rem; }
.entry-content h3 { margin: 1.5rem 0 .8rem; font-size: 1.1rem; }
.entry-content p { margin-bottom: 1rem; line-height: 1.75; color: var(--text); }
.entry-content ul, .entry-content ol {
  margin: 0 0 1rem 1.5rem;
  line-height: 1.8;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .88rem;
}
.entry-content table thead tr {
  background: var(--navy);
  color: #fff;
}
.entry-content table th,
.entry-content table td {
  padding: .5rem .8rem;
  text-align: left;
  border: 1px solid var(--border);
}
.entry-content table tbody tr:nth-child(even) { background: var(--light); }
.entry-content table tbody tr:hover { background: #e8f0ff; }

/* ═══════════════════════════════════════════════
   WIDGETS / SIDEBAR
═══════════════════════════════════════════════ */
.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.widget--dark {
  background: var(--navy);
  border-color: var(--navy);
}
.widget-title {
  font-family: var(--fh);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--border);
}
.widget--dark .widget-title {
  color: var(--gold);
  border-bottom-color: rgba(255,255,255,.1);
}
.widget-ql { list-style: none; }
.widget-ql li { border-bottom: 1px solid var(--border); }
.widget-ql a {
  display: block;
  padding: .5rem 0;
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  transition: .15s;
}
.widget-ql a:hover { color: var(--blue); padding-left: .4rem; }

/* ═══════════════════════════════════════════════
   CARDS & GRIDS
═══════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: .2s;
  box-shadow: var(--sh);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh2); }
.card-body { padding: 1.5rem; }
.card-title {
  font-family: var(--fh);
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
.card-meta { font-size: .78rem; color: var(--muted); margin-bottom: .8rem; }

/* ═══════════════════════════════════════════════
   INFO BOXES
═══════════════════════════════════════════════ */
.info-box {
  background: #f0f4ff;
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.info-box--gold {
  background: rgba(200,168,75,.08);
  border-left-color: var(--gold);
}
.info-box--olive {
  background: rgba(74,94,47,.06);
  border-left-color: var(--olive2);
}
.warning-box {
  background: #fff8e1;
  border: 1px solid var(--gold);
  border-radius: var(--r);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════
   STUDIJNÍ PLÁN — tabulky
═══════════════════════════════════════════════ */
.plan-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-bottom: 2rem; overflow-x: auto; display: block; }
.plan-table thead tr { background: var(--navy); color: #fff; }
.plan-table th, .plan-table td { padding: .45rem .7rem; }
.plan-table th { font-family: var(--fh); font-weight: 600; letter-spacing: .04em; }
.plan-table tbody tr:nth-child(even) { background: #f8f9fb; }
.plan-table tbody tr.row-vojenske { background: #e8f0ff; }
.plan-table tbody tr.row-kurz { background: #dce8ff; }
.plan-table tbody tr:hover { background: #dce8ff; }
.plan-table tfoot tr { background: var(--navy); color: #fff; font-weight: 700; }
.plan-table .code { color: #666; font-size: .78rem; }
.badge-kurz {
  background: var(--gold);
  color: var(--navy);
  font-size: .68rem;
  padding: .1rem .4rem;
  border-radius: 3px;
  margin-left: .3rem;
  font-family: var(--fh);
  font-weight: 700;
  letter-spacing: .04em;
}

/* Tab switcher pro studijní plán */
.plan-tabs { display: flex; gap: .5rem; margin-bottom: 2rem; border-bottom: 2px solid var(--border); }
.plan-tab {
  background: #eee;
  color: var(--navy);
  border: none;
  padding: .6rem 1.4rem;
  border-radius: 6px 6px 0 0;
  font-family: var(--fh);
  font-weight: 700;
  cursor: pointer;
  font-size: .9rem;
  transition: .15s;
}
.plan-tab.active { background: var(--navy); color: #fff; }

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  color: var(--gold);
  font-family: var(--fh);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .85rem;
  transition: .15s;
}
.footer-col ul a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: rgba(255,255,255,.4);
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-bottom a { color: rgba(255,255,255,.4); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }

/* ═══════════════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════════════ */
.breadcrumb {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span + span::before { content: ' / '; }

/* ═══════════════════════════════════════════════
   GUTENBERG BLOCK OVERRIDES
═══════════════════════════════════════════════ */
.wp-block-cover { min-height: 400px; }
.wp-block-separator { border-color: var(--border); }
.wp-block-quote {
  border-left: 4px solid var(--blue);
  padding-left: 1.5rem;
  color: var(--muted);
  font-style: italic;
}
.wp-block-pullquote {
  border-top: 4px solid var(--navy);
  border-bottom: 4px solid var(--navy);
  padding: 1.5rem 0;
}
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
}
.wp-block-table td, .wp-block-table th {
  border: 1px solid var(--border);
  padding: .5rem .8rem;
}
.wp-block-table thead { background: var(--navy); color: #fff; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════
   RESPONSIVE (Opraveno pro tablety a mobily)
═══════════════════════════════════════════════ */

/* TABLETY A MENŠÍ NOTEBOOKY (Vše pod 1200px) */
@media (max-width: 1199px) {
  /* 1. Hlavní menu se změní na mobilní "hamburger" dříve */
  .primary-navigation { display: none; }
  .primary-navigation.is-open { display: flex; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: var(--navy); z-index: 99; padding: 2rem; height: calc(100vh - 70px); overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
  .primary-navigation.is-open ul { flex-direction: column; width: 100%; align-items: flex-start; }
  .primary-navigation.is-open li { width: 100%; }
  .primary-navigation.is-open li > a { color: #fff; height: auto; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.1); white-space: normal; }
  
  /* 2. Zobrazení podmenu v mobilním zobrazení */
  .primary-navigation.is-open .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: rgba(0,0,0,.2); border-top: none; padding-left: 1rem; width: 100%; }
  .primary-navigation.is-open .sub-menu a { color: #fff; border-left: 2px solid var(--gold); }
  .menu-toggle { display: block; }
  
  /* 3. Rozložení stránky - boční panel (sidebar) půjde úhledně POD hlavní obsah */
  .page-grid { grid-template-columns: 1fr; gap: 2rem; }
  .sidebar { order: 2; }
  
  /* 4. Patička na tabletu do 2 sloupců */
  .footer-grid { grid-template-columns: 1fr 1fr; }
  
  /* 5. Zajištění, že se velké gridy na tabletu smrsknou */
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* MOBILNÍ TELEFONY (Vše pod 768px) */
@media (max-width: 768px) {
  /* Patička pod sebe */
  .footer-grid { grid-template-columns: 1fr; }
  
  /* Zmenšení písma v tabulkách, aby nepřetékaly */
  .plan-table { font-size: .75rem; }
  .plan-table th, .plan-table td { padding: .3rem .5rem; }
  
  /* Zmenšení obřích nadpisů v hlavičce */
  .page-hero h1 { font-size: 2.2rem; }
  
  /* Horní tmavá lišta pod sebe */
  .topbar-inner { justify-content: center; text-align: center; }
  .lang-switch { margin-left: 0; border-left: none; padding-left: 0; margin-top: 5px; width: 100%; justify-content: center; }
}

/* BEZPEČNOSTNÍ POJISTKA - globální zákaz horizontálního posuvníku */
html, body {
  overflow-x: hidden;
  width: 100%;
}