/* ============================================
   SPANISH.CARDS DESIGN SYSTEM
   ============================================ */

:root {
  /* --- HLAVNÍ BARVY (Brand) --- */
  --color-ar: #E53935;
  --color-er: #FB8C00;
  --color-ir: #00897B;

  /* --- TEXTY --- */
  --text-main:      #0F172A; /* Tmavá inkoustová */
  --text-secondary: #64748B; /* Jemná šedá pro popisky */
  --text-white:     #FFFFFF; /* Bílá */

  /* --- POZADÍ A UI --- */
  --bg-page:   #F8FAFC; /* Jemně šedé pozadí webu */
  --bg-white:  #FFFFFF; /* Čistá bílá */
  --border-ui: #E2E8F0; /* Barva rámečků */

  /* --- FONT --- */
  --font-primary: 'Inter', sans-serif;

  /* --- ACCENT (nastavuje se per-verb inline) --- */
  --accent: #E53935; /* Default, přepisuje se inline */
}

/* Global font application */
body {
  font-family: var(--font-primary);
  background: var(--bg-page);
}

/* Pravidlo pro slovesa na kartičkách */
.verb-root {
  color: var(--text-main);
  font-weight: 500; /* Medium */
}

.verb-suffix {
  color: var(--text-white);
  font-weight: 700; /* Bold */
}

.verb-suffix.ar {
  background-color: var(--color-ar);
  padding: 0 4px;
  border-radius: 4px;
}

.verb-suffix.er {
  background-color: var(--color-er);
  padding: 0 4px;
  border-radius: 4px;
}

.verb-suffix.ir {
  background-color: var(--color-ir);
  padding: 0 4px;
  border-radius: 4px;
}

/* Utility classes */
.text-main {
  color: var(--text-main);
}

.text-secondary {
  color: var(--text-secondary);
}

.bg-page {
  background-color: var(--bg-page);
}

.bg-card {
  background-color: var(--bg-white);
}

.border-ui {
  border-color: var(--border-ui);
}

/* ============================================
   COLLAPSIBLE LEGEND
   ============================================ */

details summary {
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] .legend-chevron {
  transform: rotate(180deg);
}

/* ============================================
   NAVIGATION
   ============================================ */
nav a.nav-link {
  position: relative;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  padding-bottom: 0.5rem;
}

/* Red underline for active and hover states */
nav a.nav-link.nav-active,
nav a.nav-link:hover {
  border-bottom-color: var(--color-ar);
}

/* Mobile menu specific spacing */
.mobile-menu a.nav-link {
  padding-bottom: 0.75rem;
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu {
  display: none;
}

.mobile-menu.active {
  display: block;
}

/* ============================================
   VERB CARDS (for index pages)
   ============================================ */
.verb-card {
  position: relative;
  border-bottom: 4px solid;
  background: white;
  transition: box-shadow 0.3s ease;
}

/* Bottom border color based on verb type */
.verb-card.ar {
  border-bottom-color: var(--color-ar);
}

.verb-card.er {
  border-bottom-color: var(--color-er);
}

.verb-card.ir {
  border-bottom-color: var(--color-ir);
}

.pattern-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: #F3F4F6;
  color: #6B7280;
  font-weight: 600;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

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

.breadcrumb-sep {
  width: 8px;
  height: 12px;
  color: var(--border-ui);
  flex-shrink: 0;
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
}

/* ============================================
   VERB CONJUGATION PAGES
   ============================================ */

/* Section Container */
.sc {
  max-width: 980px;
  margin: 0 auto;
}

/* ============================================
   SHARED SECTION ELEMENTS
   ============================================ */

.section-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  color: var(--accent);
}

/* ============================================
   1. USAGE TIPS — Left-border callout
   ============================================ */

.section-tip {
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, white);
  padding: 0;
  position: relative;
}

.section-tip-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem 0;
}

.section-tip p {
  margin: 0;
  line-height: 1.75;
  color: var(--text-main);
  font-size: 0.95rem;
}

/* Flip card */
.tip-flip {
  position: relative;
  perspective: 800px;
}

.tip-flip-inner {
  position: relative;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.tip-flip-inner.flipped {
  transform: rotateY(180deg);
}

.tip-flip-front,
.tip-flip-back {
  backface-visibility: hidden;
  padding: 1.25rem;
}

.tip-flip-back {
  transform: rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: color-mix(in srgb, var(--accent) 6%, white);
}

/* Language toggle */
.tip-lang-toggle {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  z-index: 1;
  transition: background 0.15s, color 0.15s;
}

.tip-lang-toggle:hover {
  background: var(--accent);
  color: white;
}

@media (min-width: 768px) {
  .tip-flip-face {
    padding: 1.5rem;
  }
}

/* ============================================
   2. PRACTICE EXERCISES — Interactive card
   ============================================ */

.section-practice {
  background: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 1.25rem;
}

.section-practice-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 0 0 1.25rem 0;
}

.section-practice .quiz-item {
  margin-bottom: 1rem;
}

.section-practice .quiz-item label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.section-practice .quiz-input {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 2px solid var(--border-ui);
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--text-main);
  background: white;
  transition: border-color 0.15s;
}

.section-practice .quiz-input:focus {
  outline: none;
  border-color: var(--accent);
}

.section-practice .quiz-feedback {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.section-practice-actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-practice-actions button {
  padding: 0.625rem 1.5rem;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.section-practice-actions button:hover {
  opacity: 0.9;
}

#quiz-result {
  font-size: 1rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .section-practice {
    padding: 1.5rem;
  }

  .section-practice .quiz-input {
    width: 50%;
  }
}

/* ============================================
   3. CULTURAL NOTE — Blockquote / Aside
   ============================================ */

.section-cultural {
  border-left: 4px solid color-mix(in srgb, var(--accent) 50%, #64748B);
  background: color-mix(in srgb, var(--accent) 4%, white);
  padding: 1.25rem;
  position: relative;
}

.section-cultural-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.section-cultural-text {
  margin: 0;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--text-main);
}

@media (min-width: 768px) {
  .section-cultural {
    padding: 1.5rem;
  }
}

/* ============================================
   4. MINI HISTORIA — Story card
   ============================================ */

.section-story {
  background: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 1.25rem;
}

.section-story-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem 0;
}

.section-story p {
  margin: 0;
  line-height: 1.9;
  font-size: 1.05rem;
  color: var(--text-main);
}

@media (min-width: 768px) {
  .section-story {
    padding: 1.5rem;
  }
}

/* ============================================
   5. SIMILAR VERBS — Link grid / chips
   ============================================ */

.section-similar {
  border-top: 1px solid var(--border-ui);
  padding-top: 1.5rem;
}

.section-similar-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.section-similar-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

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

.verb-chip {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 6%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
  font-weight: 500;
  font-size: 0.875rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}

.verb-chip:hover {
  background: color-mix(in srgb, var(--accent) 14%, white);
}

@media (min-width: 768px) {
  .section-similar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Conjugation Card */
.conj {
  position: relative;
}

.conj .topbar {
  background: var(--accent);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: .02em;
  position: relative;
}

.conj .pattern {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}

.conj .translation {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  font-weight: 300;
  opacity: 0.95;
  text-transform: none;
}

.conj .verb {
  font-weight: 800;
  font-size: clamp(24px, 5vw, 40px);
  text-align: center;
}

.conj .verb .root {
  color: #111;
}

.conj .verb .suffix {
  color: #fff;
}

.conj .verb .changed-vowel {
  color: #fff;
}

.conj .panel {
  background: #fff;
  border-left: 1px solid var(--border-ui);
  border-right: 1px solid var(--border-ui);
  border-bottom: 1px solid var(--border-ui);
  padding: 1.25rem 1.25rem 1rem;
}

/* Grid Layout */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Conjugation Box */
.box {
  position: relative;
  border: 2px solid var(--accent);
  background: #fff;
  padding: 0.9rem 1rem 0.9rem 7.5rem;
}

.box .label {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 .5rem;
  color: #111827;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
}

.box .label::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: var(--accent);
  opacity: .45;
}

.box .value {
  font-size: clamp(20px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: .5px;
  color: #111827;
  line-height: 1;
  padding-left: .5rem;
  text-transform: uppercase;
}

.value .end {
  color: var(--accent);
  text-transform: uppercase;
}

.value .changed {
  text-decoration: underline;
}

/* ============================================
   CONJUGATION CARD HIGHLIGHTING (Detail Page)
   ============================================ */

/* Base part of conjugation (dark) */
.conjugation-base {
  color: var(--text-main);
  font-weight: 700;
}

/* Stem change part (underlined) */
.conjugation-change {
  color: var(--text-main);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

/* Suffix/ending part (colored by verb type) */
.conjugation-suffix {
  font-weight: 700;
}

/* ============================================
   PREV/NEXT VERB NAVIGATION
   ============================================ */

.verb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-ui);
}

.verb-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.verb-nav-link:hover {
  background: color-mix(in srgb, var(--accent) 8%, white);
}
