/*
 * Krona Mag - Hero Stylesheet
 * Version: 0.1.0
 * Description: Hero sections for homepage, single post, archive.
 *
 * Sections:
 *   1. Homepage Hero
 *   2. Premium Section Hero
 *   3. Single Post Hero
 *   4. Archive Hero
 *   5. Page Hero
 *   6. Responsive
 */

/* =============================================
   1. HOMEPAGE HERO
   Full width image with overlay and title
   Used in: template-parts/home/hero.php
   ============================================= */

/* Hero wrapper - fixed height, overflow hidden */
.km-hero {
  position: relative;
  width: 100%;
  height: 560px;
  overflow: hidden;
  background: var(--km-header-bg);
}

/* Background image - absolute, covers everything */
.km-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

/* Dark gradient overlay - bottom to top */
.km-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.95) 0%,
    rgba(0,0,0,0.75) 50%,
    rgba(0,0,0,0.50) 100%
  );
}

/* Text content - anchored at bottom */
.km-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-bottom: 48px;
}

/* Category badge */
.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;
}

/* Hero title - fluid with 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;
}

/* Hero subtitle */
.km-hero-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  max-width: 640px;
  margin: 12px 0 16px;
  display: block;
}

/* Hero meta - author and date */
.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);
}

/* =============================================
   2. PREMIUM SECTION HERO
   Full width hero inside premium category section
   Used in: template-parts/home/section-premium.php
   ============================================= */

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

/* Premium background image */
.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;
}

/* Premium dark gradient overlay */
.km-premium-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.92) 0%,
    rgba(0,0,0,0.65) 50%,
    rgba(0,0,0,0.40) 100%
  );
}

/* Premium text content - anchored at bottom */
.km-premium-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-bottom: 40px;
}

/* Premium category badge */
.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;
}

/* Premium title */
.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: inherit;
  transition: opacity 0.2s;
}

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

/* Premium excerpt */
.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;
}

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

/* =============================================
   3. SINGLE POST HERO
   Full width hero with overlay and title
   Used in: single.php
   ============================================= */

.km-single-hero {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  background: var(--km-header-bg);
  margin-bottom: 0;
}

.km-single-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.km-single-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.0)  100%
  );
}

.km-single-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-bottom: 48px;
}

/* Single post title */
.km-single-title {
  font-size: clamp( 24px, 3.5vw, 48px );
  font-weight: 700;
  line-height: 1.2;
  max-width: 820px;
  margin: 12px 0 0;
  color: #fff;
}

.km-single-title--no-hero {
  color: var(--km-text);
  margin: 24px 0 0;
}

.km-single-header {
  padding: 40px 0 0;
}

/* =============================================
   4. ARCHIVE HERO
   Category/tag/author page hero with bg image
   Used in: archive.php
   ============================================= */

.km-archive-hero {
  background-color: var(--km-accent);
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 100px 0 80px;
  margin-bottom: 48px;
  border-bottom: 3px solid var(--km-accent);
  overflow: hidden;
}

/* Dark overlay */
.km-archive-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 0;
}

/* Content above overlay */
.km-archive-hero .km-container {
  position: relative;
  z-index: 1;
}

.km-archive-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

/* Orange label badge */
.km-archive-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fff;
  background: #f97316;
  padding: 4px 10px;
  border-radius: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Archive title */
.km-archive-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
}

/* Archive description */
.km-cat-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.8) !important;
  margin: 0;
  line-height: 1.7;
  font-family: 'Inter', sans-serif;
}

.km-archive-hero p,
.km-archive-hero p strong,
.km-cat-desc strong {
  color: rgba(255,255,255,0.8) !important;
  font-family: 'Inter', sans-serif;
}

/* Post count badge */
.km-archive-count {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--km-accent);
  padding: 4px 10px;
  border-radius: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  align-self: flex-start;
}

/* =============================================
   5. PAGE HERO
   Generic page hero with featured image
   Used in: page.php
   ============================================= */

.km-page-hero {
  position: relative;
  height: 400px;
  overflow: hidden;
  background: var(--km-header-bg);
  margin-bottom: 48px;
}

.km-page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.km-page-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1;
}

.km-page-hero-content {
  position: relative;
  z-index: 2;
  height: 400px;
  display: flex;
  align-items: center;
  padding-bottom: 0;
}

/* Page title over hero */
.km-page-title--hero {
  color: #fff;
}

/* Page header without image */
.km-page-header {
  background: var(--km-header-bg);
  padding: 48px 0;
  margin-bottom: 48px;
  border-bottom: 3px solid var(--km-accent);
}

.km-page-title {
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
}

/* =============================================
   6. HERO SPOTLIGHT
   Used by: Spotlight preset
   ============================================= */
.km-hero-spotlight {
  margin-bottom: 48px;
}

.km-hero-spotlight-main {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: var(--km-header-bg);
}

.km-hero-spotlight-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.km-hero-spotlight-main .km-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient( to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100% );
}

.km-hero-spotlight-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-bottom: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.km-hero-spotlight-content .km-hero-meta {
  justify-content: center;
}

.km-hero-spotlight-excerpt {
  font-size: 17px;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  max-width: 640px;
  margin: 16px auto 20px;
}

.km-hero-spotlight-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 32px;
}

.km-hero-spotlight-card {
  background: #fff;
  border-radius: var(--km-radius-lg);
  border: 1px solid var(--km-border);
  overflow: hidden;
  box-shadow: var(--km-shadow);
}

.km-hero-spotlight-card-img {
  display: block;
  height: 220px;
  overflow: hidden;
}

.km-hero-spotlight-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.km-hero-spotlight-card:hover .km-hero-spotlight-card-img img {
  transform: scale(1.03);
}

.km-hero-spotlight-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.km-hero-spotlight-card-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--km-text);
}

.km-hero-spotlight-card-title a {
  color: var(--km-text);
  text-decoration: none;
}

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

.km-hero-spotlight-card-excerpt {
  font-size: 14px;
  color: var(--km-text-muted);
  line-height: 1.6;
}

/* =============================================
   7. HERO CHRONICLE
   Used by: Chronicle preset
   ============================================= */
.km-hero-chronicle {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  padding: 40px 0 48px;
  align-items: start;
}

.km-hero-chronicle-main {
  position: relative;
  height: 480px;
  border-radius: var(--km-radius-lg);
  overflow: hidden;
}

.km-hero-chronicle-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.km-hero-chronicle-main .km-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient( to top, rgba(15,23,42,0.92) 0%, rgba(15,23,42,0.3) 60%, transparent 100% );
}

.km-hero-chronicle-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  z-index: 2;
}

.km-hero-chronicle-content .km-hero-title {
  font-size: 26px !important;
  margin-top: 10px;
  margin-bottom: 10px;
}

.km-hero-chronicle-content .km-hero-meta {
  margin-top: 8px;
  font-size: 12px;
}

.km-hero-chronicle-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 480px;
}

.km-hero-chronicle-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  align-items: stretch;
  background: #fff;
  border-radius: var(--km-radius);
  border: 1px solid var(--km-border);
  overflow: hidden;
  box-shadow: var(--km-shadow);
  flex: 1;
}

.km-hero-chronicle-item-img {
  display: block;
  overflow: hidden;
  min-height: 100px;
}

.km-hero-chronicle-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.km-hero-chronicle-item-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.km-hero-chronicle-item-body .km-card-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--km-accent);
}

.km-hero-chronicle-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--km-text);
  line-height: 1.4;
  margin: 0;
}

.km-hero-chronicle-item-title a {
  color: var(--km-text);
  text-decoration: none;
}

.km-hero-chronicle-item-title a:hover {
  color: var(--km-accent);
}

.km-hero-chronicle-item-body .km-card-date {
  font-size: 11px;
  color: var(--km-text-muted);
}

/* =============================================
   8. HERO ATLAS
   Used by: Atlas preset
   ============================================= */
.km-hero-atlas {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  height: 520px;
  margin-bottom: 48px;
}

.km-hero-atlas-main {
  position: relative;
  overflow: hidden;
}

.km-hero-atlas-main .km-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.km-hero-atlas-main .km-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient( to top, rgba(15,23,42,0.92) 0%, transparent 60% );
}

.km-hero-atlas-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  z-index: 2;
}

.km-hero-atlas-secondary {
  display: flex;
  flex-direction: column;
  background: var(--km-header-bg);
  overflow: hidden;
}

.km-hero-atlas-secondary-img {
  height: 260px;
  overflow: hidden;
}

.km-hero-atlas-secondary-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.km-hero-atlas-secondary-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  background: #fff;
  border: 1px solid var(--km-border);
}

.km-hero-atlas-secondary-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--km-text);
}

.km-hero-atlas-secondary-title a {
  color: var(--km-text);
  text-decoration: none;
}

.km-hero-atlas-secondary-title a:hover {
  color: var(--km-accent);
}

.km-hero-atlas-secondary-excerpt {
  font-size: 13px;
  color: var(--km-text-muted);
  line-height: 1.6;
}

/* =============================================
   7. RESPONSIVE
   ============================================= */

@media ( max-width: 768px ) {
  .km-hero {
    height: 420px;
  }
  .km-hero-content {
    padding-bottom: 32px;
  }
  .km-single-hero {
    height: 360px;
  }
  .km-premium-hero {
    height: 360px;
  }
  .km-archive-title {
    font-size: 28px;
  }
  .km-page-title {
    font-size: 28px;
  }
  .km-hero-spotlight-main { height: 380px; }
  .km-hero-spotlight-cards { grid-template-columns: 1fr; }
  .km-hero-chronicle { grid-template-columns: 1fr; }
  .km-hero-chronicle-main { height: 320px; }
  .km-hero-atlas { grid-template-columns: 1fr; height: auto; }
  .km-hero-atlas-main { height: 320px; }
}