/*
 * Krona Mag — Main Stylesheet
 * Version: 0.1.0
 * Description: Stili principali del tema magazine.
 * Struttura:
 *   1. Variables (in style.css)
 *   2. Layout Base
 *   3. Header
 *   4. Hero
 *   5. Section Titles
 *   6. Featured Grid
 *   7. Category Rows
 *   8. Card Generica
 *   9. Footer
 *  10. Responsive
 *  11. Premium Category Section
 */

/* =============================================
   2. LAYOUT BASE
   ============================================= */

/* Contenitore centrato con max-width e padding laterale */
.km-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Main — nessun padding, le sezioni gestiscono il proprio spazio */
.km-main {
  padding: 0;
  margin-top: 0;
}

/* Compensazione admin bar WordPress (visibile solo da admin) */
.admin-bar .km-header {
  top: 32px;
}

@media screen and ( max-width: 782px ) {
  .admin-bar .km-header {
    top: 46px;
  }
}

/* Layout contenuto + sidebar (usato su single, archive) */
.km-layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 48px 0;
  align-items: start;
}

/* Colonna contenuto principale — min-width:0 evita overflow */
.km-content-area {
  min-width: 0;
}

/* Sidebar sticky sotto l'header */
.km-sidebar {
  position: sticky;
  top: 100px;
}

/* =============================================
   3. HEADER
   ============================================= */

/* Header scuro sticky con bordo inferiore semitrasparente */
.km-header {
  background: var(--km-header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: box-shadow 0.3s ease;
}

/* Ombra aggiuntiva quando si scrolla */
.km-header--sticky {
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

/* Flex row: logo | menu | toggle */
.km-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 24px;
}

/* Logo — flex centrato verticalmente */
.km-logo a {
  display: flex;
  align-items: center;
  height: 100%;
}

.km-logo-img {
  height: 40px;
  width: auto;
}

.km-logo-text {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Logo custom caricato dal Customizer */
.km-logo .custom-logo {
  height: 40px;
  width: auto;
}

/* Menu principale — flex row con gap */
.km-nav .km-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Link menu — colore bianco semitrasparente */
.km-nav .km-menu li a {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--km-radius);
  transition: background 0.2s, color 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-nav .km-menu li a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Bottone hamburger mobile — nascosto su desktop */
.km-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.km-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}

/* =============================================
   4. HERO HOMEPAGE
   Usato in: template-parts/home/hero.php
   Struttura: immagine sfondo + overlay + testo
   ============================================= */

/* Wrapper hero — altezza fissa, overflow hidden */
.km-hero {
  position: relative;
  width: 100%;
  height: 560px;
  overflow: hidden;
  background: var(--km-header-bg);
}

/* Immagine di sfondo — assoluta, copre tutto */
.km-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.km-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay gradiente scuro dal basso verso l'alto */
.km-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.4)  50%,
    rgba(0,0,0,0.1)  100%
  );
}

/* Testo sovrapposto — ancorato in basso */
.km-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-bottom: 48px;
}

/* Badge categoria hero */
.km-hero-cat {
  display: inline-block;
  background: var(--km-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--km-radius);
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background 0.2s;
}

.km-hero-cat:hover {
  background: var(--km-accent-dark);
  color: #fff;
}

/* Titolo hero — fluid con clamp */
.km-hero-title {
  font-size: clamp( 28px, 4vw, 52px );
  font-weight: 700;
  line-height: 1.15;
  max-width: 780px;
  margin-bottom: 20px;
}

.km-hero-title a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.km-hero-title a:hover {
  opacity: 0.85;
}

/* Meta hero — autore e data */
.km-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-hero-author {
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

/* Responsive hero */
@media ( max-width: 768px ) {
  .km-hero {
    height: 420px;
  }
  .km-hero-content {
    padding-bottom: 32px;
  }
}

/* =============================================
   5. TITOLI SEZIONE
   Usato in: tutte le sezioni homepage
   ============================================= */

/* Flex row: titolo | linea decorativa | link "See all" */
.km-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

/* Titolo sezione — uppercase piccolo, colore accento */
.km-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--km-accent);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
}

.km-section-title a {
  color: var(--km-accent);
}

.km-section-title a:hover {
  color: var(--km-accent-dark);
}

/* Linea decorativa — si estende per riempire lo spazio */
.km-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--km-border);
}

/* Link "See all" — a destra del titolo */
.km-see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--km-accent);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
  white-space: nowrap;
}

.km-see-all:hover {
  color: var(--km-accent-dark);
}

/* =============================================
   6. FEATURED GRID
   Usato in: template-parts/home/grid-featured.php
   Layout: 3 card uguali, testo senza immagine
   Responsive: 3col -> 2col -> 1col
   ============================================= */

/* Wrapper sezione — centrato, spazio sopra e sotto */
.km-featured {
  margin-top: 48px;
  margin-bottom: 48px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Griglia 3 colonne uguali */
.km-featured-grid {
  display: grid;
  grid-template-columns: repeat( 3, 1fr );
  gap: 24px;
}

/* Card featured — bianca con bordo sottile */
.km-featured-card {
  background: var(--km-surface);
  border-radius: var(--km-radius-lg);
  border: 1px solid var(--km-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.km-featured-card:hover {
  box-shadow: var(--km-shadow-md);
  transform: translateY( -2px );
}

/* Body card — flex colonna per spingere data in fondo */
.km-featured-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Badge categoria featured */
.km-featured-card .km-card-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--km-accent);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 8px;
  display: inline-block;
  transition: color 0.2s;
}

.km-featured-card .km-card-cat:hover {
  color: var(--km-accent-dark);
}

/* Titolo card featured */
.km-featured-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-featured-card-title a {
  color: var(--km-text);
  transition: color 0.2s;
}

.km-featured-card-title a:hover {
  color: var(--km-accent);
}

/* Excerpt — 20 parole, muted, flex:1 spinge data in fondo */
.km-featured-card-excerpt {
  font-size: 13px;
  color: var(--km-text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  flex: 1;
}

/* Meta data featured — solo data in V1 */
.km-featured-card .km-card-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--km-border);
  font-size: 11px;
  color: var(--km-text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* =============================================
   7. CATEGORY ROWS
   Usato in: template-parts/home/category-row.php
   Layout: titolo categoria + 4 card con immagine
   Responsive: 4col -> 2col -> 1col
   ============================================= */

/* Category row standard — larghezza massima 1280px centrata */
.km-cat-row {
  margin-bottom: 56px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

/* Griglia 4 colonne uguali */
.km-cat-grid {
  display: grid;
  grid-template-columns: repeat( 4, 1fr );
  gap: 20px;
}

/* Card categoria — con immagine in cima */
.km-cat-card {
  background: var(--km-surface);
  border-radius: var(--km-radius-lg);
  border: 1px solid var(--km-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.km-cat-card:hover {
  box-shadow: var(--km-shadow-md);
  transform: translateY( -2px );
}

/* Immagine card categoria — altezza fissa, zoom su hover */
.km-cat-card-img-wrap {
  display: block;
  overflow: hidden;
}

.km-cat-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.km-cat-card:hover .km-cat-card-img {
  transform: scale( 1.04 );
}

/* Body card categoria */
.km-cat-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Titolo card categoria */
.km-cat-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin: 8px 0 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  flex: 1;
}

.km-cat-card-title a {
  color: var(--km-text);
  transition: color 0.2s;
}

.km-cat-card-title a:hover {
  color: var(--km-accent);
}

/* =============================================
   8. CARD GENERICA
   Usata in: template-parts/post/card.php
   ============================================= */

/* Card base — bordo, ombra, hover */
.km-card {
  background: var(--km-surface);
  border-radius: var(--km-radius-lg);
  border: 1px solid var(--km-border);
  overflow: hidden;
  box-shadow: var(--km-shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.km-card:hover {
  box-shadow: var(--km-shadow-md);
  transform: translateY( -2px );
}

/* Immagine card */
.km-card-img-wrap {
  display: block;
  overflow: hidden;
}

.km-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

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

/* Body card */
.km-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Badge categoria — usato in tutte le card */
.km-card-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--km-accent);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.km-card-cat:hover {
  color: var(--km-accent-dark);
}

/* Titolo card */
.km-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-card-title a {
  color: var(--km-text);
  transition: color 0.2s;
}

.km-card-title a:hover {
  color: var(--km-accent);
}

/* Excerpt card */
.km-card-excerpt {
  font-size: 13px;
  color: var(--km-text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Meta data — data e autore, configurabile in V2 */
.km-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--km-text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--km-border);
}

/* Nome autore in grassetto */
.km-card-author {
  font-weight: 500;
}

/* Separatore punto tra autore e data */
.km-card-sep {
  opacity: 0.5;
}

/* =============================================
   9. FOOTER
   ============================================= */

/* Footer scuro con padding */
.km-footer {
  background: var(--km-header-bg);
  color: rgba(255,255,255,0.7);
  margin-top: 60px;
  padding: 48px 0 24px;
}

/* Griglia 4 colonne widget */
.km-footer-widgets {
  display: grid;
  grid-template-columns: repeat( 4, 1fr );
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Copyright centrato */
.km-footer-bottom {
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-footer-bottom a {
  color: var(--km-accent);
}

/* Titolo widget footer */
.km-widget-title {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* =============================================
   10. RESPONSIVE
   Breakpoints:
   - Tablet:  <= 1024px
   - Mobile:  <=  768px
   - Small:   <=  640px
   - XSmall:  <=  480px
   ============================================= */

@media ( max-width: 1024px ) {
  .km-layout-with-sidebar { grid-template-columns: 1fr; }
  .km-sidebar { position: static; }
  .km-featured-grid { grid-template-columns: repeat( 2, 1fr ); }
  .km-cat-grid { grid-template-columns: repeat( 2, 1fr ); }
  .km-premium-grid { grid-template-columns: repeat( 2, 1fr ); }
}

@media ( max-width: 768px ) {
  .km-menu-toggle { display: flex; }
  .km-nav {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--km-header-bg);
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 99;
  }
  .km-nav.km-nav--open { display: block; }
  .km-nav .km-menu { flex-direction: column; align-items: flex-start; gap: 4px; }
  .km-footer-widgets { grid-template-columns: repeat( 2, 1fr ); gap: 24px; }
  .km-premium-hero { height: 360px; }
}

@media ( max-width: 640px ) {
  .km-featured-grid { grid-template-columns: 1fr; }
  .km-cat-grid { grid-template-columns: 1fr; }
  .km-premium-grid { grid-template-columns: 1fr; }
}

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

/* =============================================
   11. PREMIUM CATEGORY SECTION
   Usato in: template-parts/home/category-row.php
   Prima categoria per numero di articoli.
   Layout: hero full width + griglia 4 colonne
   ============================================= */

/* Sezione wrapper — gradiente blu verso bianco, full width */
.km-premium-section {
  background: linear-gradient(
    to bottom,
    #3b6fa0 0%,
    #5a8bbf 60%,
    #ffffff 100%
  );
  margin-bottom: 6px;
  padding-bottom: 40px;
  width: 100%;
}

/* Wrapper griglia premium — spazio sopra e sotto */
.km-premium-grid-wrap {
  width: 100%;
  padding: 60px 0;
}

/* Premium hero — full width, NO 100vw per evitare overflow */
.km-premium-hero {
  position: relative;
  width: 100%;
  height: 460px;
  overflow: hidden;
  background: #2a5280;
}

/* Immagine di sfondo premium */
.km-premium-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.km-premium-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay gradiente scuro premium */
.km-premium-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.80) 0%,
    rgba(0,0,0,0.35) 50%,
    rgba(0,0,0,0.10) 100%
  );
}

/* Contenuto testo premium — ancorato in basso */
.km-premium-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-bottom: 40px;
}

/* Badge categoria premium */
.km-premium-cat {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: var(--km-radius);
  margin-bottom: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border: 1px solid rgba(255,255,255,0.3);
  transition: background 0.2s;
}

.km-premium-cat:hover {
  background: rgba(255,255,255,0.35);
  color: #fff;
}

/* Titolo premium */
.km-premium-title {
  font-size: clamp( 24px, 3vw, 44px );
  font-weight: 700;
  line-height: 1.2;
  max-width: 720px;
  margin-bottom: 16px;
  color: #fff;
}

.km-premium-title a {
  color: #fff;
  transition: opacity 0.2s;
}

.km-premium-title a:hover {
  opacity: 0.85;
}

/* Excerpt premium */
.km-premium-excerpt {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  max-width: 620px;
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Meta data premium */
.km-premium-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Griglia 4 colonne premium */
.km-premium-grid {
  display: grid;
  grid-template-columns: repeat( 4, 1fr );
  gap: 16px;
}

/* Card premium — sfondo bianco semitrasparente */
.km-premium-card {
  background: rgba(255,255,255,0.95);
  border-radius: var(--km-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.km-premium-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transform: translateY( -2px );
}

/* Immagine card premium */
.km-premium-card-img-wrap {
  display: block;
  overflow: hidden;
}

.km-premium-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.km-premium-card:hover .km-premium-card-img {
  transform: scale( 1.04 );
}

/* Body card premium */
.km-premium-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Titolo card premium */
.km-premium-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-premium-card-title a {
  color: var(--km-text);
  transition: color 0.2s;
}

.km-premium-card-title a:hover {
  color: #3b6fa0;
}

/* Meta card premium */
.km-premium-card .km-card-meta {
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* =============================================
   STANDARD CATEGORY ROW — 2 column layout
   Used in: template-parts/home/category-row.php
   Structure: large article left + 3 cards right
   + 4-column grid below
   ============================================= */

/* Top row: 2 columns — 2/3 left + 1/3 right */
.km-cat-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Main article left — with image */
.km-cat-main {
  background: var(--km-surface);
  border-radius: var(--km-radius-lg);
  border: 1px solid var(--km-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.km-cat-main:hover {
  box-shadow: var(--km-shadow-md);
  transform: translateY( -2px );
}

/* Main article image — fixed height */
.km-cat-main-img-wrap {
  display: block;
  overflow: hidden;
}

.km-cat-main-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.km-cat-main:hover .km-cat-main-img {
  transform: scale( 1.03 );
}

/* Main article body */
.km-cat-main-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Main article title */
.km-cat-main-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 8px 0 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-cat-main-title a {
  color: var(--km-text);
  transition: color 0.2s;
}

.km-cat-main-title a:hover {
  color: var(--km-accent);
}

/* Main article excerpt */
.km-cat-main-excerpt {
  font-size: 14px;
  color: var(--km-text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  flex: 1;
}

/* Sidebar right — 3 cards stacked */
.km-cat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Sidebar card — no image */
.km-cat-side-card {
  background: var(--km-surface);
  border-radius: var(--km-radius-lg);
  border: 1px solid var(--km-border);
  transition: box-shadow 0.2s, transform 0.2s;
  flex: 1;
}

.km-cat-side-card:hover {
  box-shadow: var(--km-shadow-md);
  transform: translateY( -2px );
}

/* Sidebar card body */
.km-cat-side-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Sidebar card title */
.km-cat-side-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin: 6px 0 10px;
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.km-cat-side-title a {
  color: var(--km-text);
  transition: color 0.2s;
}

.km-cat-side-title a:hover {
  color: var(--km-accent);
}

/* Responsive — tablet: single column */
@media ( max-width: 1024px ) {
  .km-cat-top {
    grid-template-columns: 1fr;
  }
}

/* Sidebar card excerpt */
.km-cat-side-excerpt {
  font-size: 13px;
  color: var(--km-text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}