/* =============================================================
   Homepage – Magazine Layout
   ============================================================= */

/* ── Outer wrapper ─────────────────────────────────────────── */
.hp-magazine {
  background: var(--color-bg);
}

/* Latest-posts + sidebar layout — fully independent from .site-content */
.hp-main-wrap { width: 100%; }
.hp-main      { min-width: 0; }

/* Align sidebar top with the "Latest Posts" section heading */
.hp-main-wrap #secondary { padding-top: var(--space-xl); }

@media (min-width: 1024px) {
  .hp-main-wrap.hp-sidebar-right,
  .hp-main-wrap.hp-sidebar-left {
    display: grid;
    gap:     var(--space-xl);
  }
  .hp-main-wrap.hp-sidebar-right { grid-template-columns: 1fr minmax(200px, calc(100% - var(--main-width) - var(--space-xl))); }
  .hp-main-wrap.hp-sidebar-left  { grid-template-columns: minmax(200px, calc(100% - var(--main-width) - var(--space-xl))) 1fr; }
}

.hp-magazine .hp-body {
  max-width: var(--content-width);
  margin:    0 auto;
  padding:   var(--space-l) var(--space-l) 0;
}


/* =============================================================
   HERO SLIDER
   ============================================================= */
.hp-slider {
  position:      relative;
  overflow:      hidden;
  background:    #111;
  border-radius: var(--radius-m, 8px);
  margin-bottom: var(--space-xl);
}

/* Scroll-snap track */
.hp-slider__track {
  display:               flex;
  overflow-x:            auto;
  scroll-snap-type:      x mandatory;
  scrollbar-width:       none;        /* Firefox */
  -ms-overflow-style:    none;        /* IE/Edge */
  scroll-behavior:       smooth;
}
.hp-slider__track::-webkit-scrollbar { display: none; }

/* Individual slide */
.hp-slider__slide {
  position:        relative;
  flex:            0 0 100%;
  scroll-snap-align: start;
  min-height:      480px;
  display:         flex;
  align-items:     flex-end;
  overflow:        hidden;
}
@media (max-width: 600px) {
  .hp-slider__slide { min-height: 300px; }
}

/* Background image */
.hp-slider__bg {
  position: absolute;
  inset:    0;
  margin:   0;
}
.hp-slider__bg img {
  width:     100%;
  height:    100%;
  object-fit: cover;
  border-radius: 0;
}

/* Gradient overlay */
.hp-slider__overlay {
  position:   absolute;
  inset:      0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, .85) 0%,
    rgba(0, 0, 0, .40) 50%,
    rgba(0, 0, 0, .05) 100%
  );
  z-index: 1;
}

/* Text content */
.hp-slider__content {
  position:   relative;
  z-index:    2;
  padding:    var(--space-xl) var(--space-xl) calc(var(--space-xl) + 2rem);
  color:      #fff;
  max-width:  680px;
}
@media (max-width: 600px) {
  .hp-slider__content { padding: var(--space-l) var(--space-m) calc(var(--space-l) + 2rem); }
}

.hp-slider__cat {
  display:          inline-block;
  background:       var(--color-primary);
  color:            #fff;
  font-size:        0.7rem;
  font-weight:      700;
  letter-spacing:   0.08em;
  text-transform:   uppercase;
  padding:          .2em .6em;
  border-radius:    var(--radius-s);
  margin-bottom:    var(--space-s);
  text-decoration:  none;
}
.hp-slider__cat:hover { opacity: .85; text-decoration: none; }

.hp-slider__title {
  font-size:   clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.2;
  margin:      0 0 var(--space-s);
  color:       #fff;
}
.hp-slider__title a {
  color:           #fff;
  text-decoration: none;
}
.hp-slider__title a:hover { text-decoration: underline; }

.hp-slider__meta {
  font-size:  var(--font-size-sm);
  color:      rgba(255,255,255,.75);
  display:    flex;
  gap:        var(--space-m);
  flex-wrap:  wrap;
}

/* Dot navigation */
.hp-slider__dots {
  position:    absolute;
  bottom:      var(--space-m);
  left:        50%;
  transform:   translateX(-50%);
  display:     flex;
  gap:         8px;
  z-index:     3;
}
.hp-slider__dot {
  width:         10px;
  height:        10px;
  border-radius: 50%;
  background:    rgba(255,255,255,.5);
  border:        2px solid rgba(255,255,255,.7);
  display:       block;
  transition:    background .2s, transform .2s;
}
.hp-slider__dot:hover,
.hp-slider__dot:focus {
  background:      rgba(255,255,255,1);
  transform:       scale(1.2);
  text-decoration: none;
  outline:         none;
}


/* =============================================================
   CATEGORY COLUMNS
   ============================================================= */
.hp-columns {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   var(--space-xl);
  padding:               var(--space-xl) 0;
  border-bottom:         1px solid var(--color-border);
}
@media (max-width: 900px) {
  .hp-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hp-columns { grid-template-columns: 1fr; }
}

/* Equal-height columns — list fills remaining space */
.hp-col {
  display:        flex;
  flex-direction: column;
}
.hp-col__list {
  flex: 1;
}

/* Column header */
.hp-col__header {
  border-bottom:  2px solid var(--color-primary);
  margin-bottom:  var(--space-m);
  padding-bottom: var(--space-xs);
}
.hp-col__title {
  font-size:     var(--font-size-md);
  font-weight:   700;
  margin:        0;
  color:         var(--color-text);
}
.hp-col__title a {
  color:           var(--color-text);
  text-decoration: none;
}
.hp-col__title a:hover { color: var(--color-primary); text-decoration: none; }

/* Post list */
.hp-col__list {
  list-style: none;
  padding:    0;
  margin:     0;
}
.hp-col__item {
  display:       flex;
  gap:           var(--space-s);
  padding:       var(--space-s) 0;
  border-bottom: 1px solid var(--color-border);
  align-items:   flex-start;
  min-height:    80px;
}
.hp-col__item:last-child { border-bottom: none; }

/* Thumbnail */
.hp-col__thumb {
  flex:          0 0 72px;
  width:         72px;
  height:        54px;
  overflow:      hidden;
  border-radius: var(--radius-s);
  display:       block;
}
.hp-col__thumb img {
  width:        100%;
  height:       100%;
  object-fit:   cover;
  border-radius: 0;
}

/* Text area */
.hp-col__text {
  flex:    1;
  display: flex;
  flex-direction: column;
  gap:     2px;
}
.hp-col__item-title {
  font-size:             var(--font-size-sm);
  font-weight:           600;
  line-height:           1.4;
  min-height:            4.2em; /* 3 lines × 1.4 — keeps date/readmore aligned */
  color:                 var(--color-text);
  display:               -webkit-box;
  -webkit-line-clamp:    3;
  -webkit-box-orient:    vertical;
  overflow:              hidden;
}
.hp-col__item-title:hover { color: var(--color-primary); text-decoration: none; }

.hp-col__date {
  font-size: 0.75rem;
  color:     var(--color-muted);
}
.hp-col__text .loop-item__more {
  margin-top: 2px;
  font-size:  0.7rem;
}


/* =============================================================
   LATEST POSTS SECTION
   ============================================================= */
.hp-loop {
  padding: var(--space-xl) 0;
}
.hp-loop__header {
  border-bottom:  2px solid var(--color-primary);
  margin-bottom:  var(--space-l);
  padding-bottom: var(--space-xs);
  display:        flex;
  align-items:    baseline;
  justify-content: space-between;
}
.hp-loop__title {
  font-size:  var(--font-size-lg);
  font-weight: 700;
  margin:      0;
  color:       var(--color-text);
}
.hp-loop__viewall {
  font-size:       var(--font-size-sm);
  color:           var(--color-primary);
  text-decoration: none;
  white-space:     nowrap;
}
.hp-loop__viewall:hover { text-decoration: underline; }

/* The loop grid/list reuses existing loops.css classes (.loop--card-grid, .loop--list). */
/* No extra overrides needed here. */

.hp-loop__footer {
  text-align: center;
  padding-top: var(--space-xl);
}
.hp-loop__all-btn {
  display:         inline-block;
  padding:         var(--space-s) var(--space-xl);
  background:      var(--color-primary);
  color:           #fff;
  border-radius:   var(--radius-s);
  font-weight:     600;
  text-decoration: none;
  transition:      opacity .2s;
}
.hp-loop__all-btn:hover { opacity: .85; text-decoration: none; color: #fff; }
