
/* -------------------------
   LAYOUT
   ------------------------- */

/* Block spacing – single place to adjust gaps between homepage sections */
:root{
  --dfl-block-gap: 30px;
  --dfl-section-head-bottom: 14px;
  --dfl-card-stack-gap: 20px;
}

.dfl-home{
  max-width: var(--dfl-rail-max);
  margin: 0 auto;
  padding-left: var(--dfl-rail-pad);
  padding-right: var(--dfl-rail-pad);
}

.dfl-pop{
  margin-top: var(--dfl-block-gap);
  padding-top: 0;
  padding-bottom: 0;
}
.dfl-latest{
  margin-top: var(--dfl-block-gap);
  padding-top: 0;
  padding-bottom: 0;
}

/* Tablet: layout adjustments */
@media (max-width: 1024px) {
  .dfl-top {
    grid-template-columns: 1fr;
  }

  .dfl-top__title {
    font-size: clamp(32px, 5vw, 42px);
  }

  .dfl-top__dek {
    font-size: 18px;
  }

  .dfl-pop__title {
    font-size: 20px;
  }

  .dfl-pop__meta {
    font-size: 14px;
  }

  .dfl-latest__list {
    gap: var(--dfl-card-stack-gap);
  }

  .dfl-latest__postTitle {
    font-size: 30px;
  }

  .dfl-latest__excerpt {
    font-size: 18px;
  }

  .dfl-latest__item {
    grid-template-columns: 1fr;
  }

  .dfl-latest__loadMore {
    min-height: 44px;
    padding: 12px 28px;
    font-size: 15px;
  }
}

/* -------------------------
   HERO (Featured)
   ------------------------- */

/* Hero: same padding, radius, shadow as post cards */
.dfl-top{
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr); 
  align-items: stretch;
  position: relative;
  padding-top: clamp(10px, 1.5vw, 18px);
  padding-bottom: clamp(10px, 1.5vw, 18px);
  padding-left: clamp(16px, 2vw, 24px);
  padding-right: clamp(16px, 2vw, 24px);
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.dfl-top__left,
.dfl-top__right{
  position: relative;
}

.dfl-top__left{
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dfl-top__title{
  margin:0;       
  font-family: var(--dfl-heading-font);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: left;
  text-transform: capitalize;
  padding-right: 15px;
}

.dfl-top__title a,
.dfl-pop__title{
  color: var(--dfl-dark);
}

/* Clamp hero + popular titles to 2 lines */
.dfl-top__title,
.dfl-pop__title{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dfl-top__title a{
  text-decoration: none;
}

.dfl-top__title a:hover,
.dfl-pop__link:hover .dfl-pop__title{
  color: var(--dfl-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.dfl-top__dek{
  margin: 20px 0 0;          
  max-width: 44ch;
  color: var(--dfl-dark);
  font-size: 17px;           
  line-height: 1.5;
  font-weight: 400;
}

/* Dek visibility by breakpoint: desktop 40w, tablet 32w, mobile 25w */
.dfl-top__dek--tablet,
.dfl-top__dek--mobile{
  display: none;
}

@media (max-width: 1024px){
  .dfl-top__dek--desktop{
    display: none;
  }

  .dfl-top__dek--tablet{
    display: block;
  }
}

@media (max-width: 768px){
  .dfl-top__dek--tablet{
    display: none;
  }

  .dfl-top__dek--mobile{
    display: block;
  }
}

.dfl-top__dek + .dfl-top__readmore{
  margin-top: 8px;
  align-self: flex-start;
}

.dfl-top__date{
  color: var(--dfl-dark);
  opacity: 0.7;
  font-weight: 400;
  margin-left: 4px;
}

.dfl-top__meta{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.2;
}

.dfl-top__readmore{
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--dfl-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease;
  line-height: 1.4;
}

.dfl-top__readmore:hover{
  background: var(--dfl-red);
  color: #fff;
}

.dfl-top__readmore:active{
  background: var(--dfl-red);
  color: #fff;
  opacity: 0.95;
}

.dfl-top__by{
  color: var(--dfl-dark);
  opacity: 0.85;
  font-weight: 500;
}

.dfl-top__authorName{
  color: var(--dfl-accent);
  font-weight: 700;
  font-size: 15px;
}

.dfl-top__sep{
  opacity: 0.6;
}

.dfl-top__right{
  min-width:0;
}

.dfl-top__imageWrap{
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.25s ease;
}

.dfl-top__imageWrap:hover{
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.dfl-top__imageLink{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.dfl-top__image,
.dfl-top__imageFallback{
  width: 100%;
  display: block;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.dfl-top__imageWrap:hover .dfl-top__image,
.dfl-top__imageWrap:hover .dfl-top__imageFallback{
  transform: scale(1.03);
}

.dfl-top__imageFallback{
  background: rgba(0,0,0,0.08);
}

/* -------------------------
   POPULAR (4-up row)
   ------------------------- */

.dfl-pop{
  background-color: #FFFFFF;
}

.dfl-pop__head{
  padding: 0;
  padding-bottom: var(--dfl-section-head-bottom);
  margin-top: 0;
  margin-bottom: 0;
}

.dfl-pop__heading,
.dfl-latest__title{
  margin: 0;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  color: var(--dfl-dark);
}

.dfl-pop__grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
  overflow: visible;
  margin-top: 0;
}

.dfl-pop__item{
  min-width: 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  overflow: visible;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr;
  position: relative;
  padding: clamp(16px, 2vw, 24px);
}

.dfl-pop__item:hover{
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Hover transform only on devices that support hover (desktop); touch devices skip */
@media (hover: hover){
  .dfl-pop__item:hover{
    transform: translateY(-3px);
  }
}

.dfl-pop__item:active{
  opacity: 0.97;
}

.dfl-pop__link{
  display: block;
  color: inherit;
  padding: 0;
  grid-area: 1 / 1 / -1 / -1;
}

/* Popular: badge inside thumbWrap – uses base .dfl-comment-badge (bottom: 5px, left: 12px) like hero */

/* -------------------------
   category pill (base – before responsive so 768 overrides win)
   ------------------------- */
.dfl-pill{
  position: absolute;
  top: 5px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(41, 128, 185, 0.82);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.dfl-pill:hover{
  opacity: 0.9;
  color: #fff;
}

.dfl-pill.is-exclusive{
  background: rgba(231, 76, 60, 0.88);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* -------------------------
   comment badge (base – before responsive so 768 overrides win)
   muted: small icon + number
   ------------------------- */
.dfl-comment-badge{
  position: absolute;
  bottom: 5px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(28, 25, 23, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.dfl-comment-badge:hover{
  opacity: 0.92;
  color: rgba(255, 255, 255, 0.95);
}

.dfl-comment-badge svg{
  flex-shrink: 0;
  width: 10px;
  height: 10px;
}

.dfl-pop__thumbWrap{
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.dfl-pop__thumb,
.dfl-pop__thumbFallback{
  width: 100%;
  display: block;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.dfl-pop__item:hover .dfl-pop__thumb,
.dfl-pop__item:hover .dfl-pop__thumbFallback{
  transform: scale(1.04);
}

.dfl-pop__thumbFallback{
  background: rgba(0,0,0,0.08);
}

.dfl-pop__title{
  margin: 12px 0 0;
  font-family: var(--dfl-heading-font);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

.dfl-pop__meta{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 0; /* few px under title */
  font-size: 14px;
  line-height: 1.2;
}

.dfl-pop__by{
  color: var(--dfl-dark);
  opacity: 0.85;
  font-weight: 500;
}

.dfl-pop__authorName{
  color: var(--dfl-accent);
  font-weight: 600;
  font-size: 15px;
}

.dfl-pop__date{
  color: var(--dfl-dark);
  opacity: 0.7;
  font-weight: 400;
  margin-left: 4px;
}

/* -------------------------
   Responsive
   ------------------------- */

/* Tablet: 1024px only (769–1024px) */
@media (max-width: 1024px) and (min-width: 769px){
  .dfl-pop__grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* Mobile: 768px */
@media (max-width: 768px){
  /* Hero: image on top, text below, full width */
  .dfl-top{
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dfl-top__right{
    order: -1;
    width: 100%;
  }

  .dfl-top__left{
    order: 1;
    width: 100%;
    padding-top: 20px;
  }

  .dfl-top__title{
    padding-right: 0;
  }

  .dfl-top__imageWrap,
  .dfl-top__image,
  .dfl-top__imageFallback{
    width: 100%;
  }

  /* Hero comment pill: match popular placement (tight to bottom-left corner) */
  .dfl-top__imageWrap .dfl-comment-badge{
    left: 3px;
    bottom: 3px;
  }

  .dfl-pop__grid{
    gap: 12px;
  }

  .dfl-pop__heading,
  .dfl-latest__title{
    font-size: 22px;
  }

  /* Pill/badge: compact sizing at 768px */
  .dfl-pill{
    min-width: auto;
    min-height: auto;
    padding: 4px 8px;
    font-size: 11px;
    -webkit-tap-highlight-color: transparent;
  }

  .dfl-comment-badge{
    min-width: auto;
    min-height: auto;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    -webkit-tap-highlight-color: transparent;
  }

  .dfl-comment-badge svg{
    width: 11px;
    height: 11px;
  }

  .dfl-latest__list{
    gap: var(--dfl-card-stack-gap);
  }

  /* Latest at 768: stacked card, image first, edge-aligned with Popular above */
  .dfl-latest__item{
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dfl-latest__body{
    padding-top: 0;
  }

  .dfl-latest__postTitle{
    margin-top: 10px;
  }

  .dfl-latest__excerpt{
    margin-top: 6px;
  }

  .dfl-latest__meta{
    margin-top: 6px;
  }

  /* Pills match hero/popular: category top-right, comment bottom-left (tight like hero) */
  .dfl-latest__media .dfl-comment-badge{
    left: 3px;
    bottom: 3px;
  }
}

/* -------------------------
   LATEST (5-up list)
   ------------------------- */

.dfl-latest{
  position: relative;
}

.dfl-latest__head,
.dfl-latest__list,
.dfl-latest__loadMoreWrap{
  position: relative;
}

.dfl-latest__head{
  padding: 0;
  padding-bottom: var(--dfl-section-head-bottom);
  margin-top: 0;
  margin-bottom: 0;
}


.dfl-latest__list{
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--dfl-card-stack-gap);
}

.dfl-latest__loadMoreWrap{
  margin-top: 25px;
  margin-bottom: 36px;
  display: flex;
  justify-content: center;
}

.dfl-latest__loadMore{
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.dfl-latest__loadMore.has-more{
  background: var(--dfl-blue);
}

.dfl-latest__loadMore.has-more:hover{
  opacity: 0.9;
}

.dfl-latest__loadMore.no-more,
.dfl-latest__loadMore:disabled{
  background: rgba(0,0,0,.18);
  cursor: not-allowed;
  opacity: 0.65;
  pointer-events: none;
}

.dfl-latest__item{
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.65fr);
  gap: 18px;
  align-items: start;
  padding: clamp(16px, 2vw, 24px);
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: box-shadow 0.25s ease;
}

.dfl-latest__item:hover{
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.dfl-latest__item:active{
  opacity: 0.97;
}

.dfl-latest__link{
  color: inherit;
}

.dfl-latest__media{
  min-width: 0;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.dfl-latest__mediaLink{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.dfl-latest__img,
.dfl-latest__imgFallback{
  width: 100%;
  display: block;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.dfl-latest__item:hover .dfl-latest__img,
.dfl-latest__item:hover .dfl-latest__imgFallback{
  transform: scale(1.03);
}

.dfl-latest__imgFallback{
  background: rgba(0,0,0,0.08);
}

.dfl-latest__body{
  min-width: 0;
  padding-top: 2px;
}

.dfl-latest__postTitle{
  margin: 0;
  font-family: var(--dfl-heading-font);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  color: var(--dfl-dark);

  /* 2-line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dfl-latest__link:hover .dfl-latest__postTitle{
  color: var(--dfl-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.dfl-latest__excerpt{
  margin: 10px 0 0;
  color: var(--dfl-dark);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;

  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dfl-latest__excerpt--tablet,
.dfl-latest__excerpt--mobile{
  display: none;
}

@media (max-width: 1024px){
  .dfl-latest__excerpt--desktop{
    display: none;
  }

  .dfl-latest__excerpt--tablet{
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 768px){
  .dfl-latest__excerpt--desktop,
  .dfl-latest__excerpt--tablet{
    display: none;
  }

  .dfl-latest__excerpt--mobile{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.dfl-latest__meta{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.2;
}

.dfl-latest__by{
  color: var(--dfl-dark);
  opacity: 0.85;
  font-weight: 500;
}

.dfl-latest__authorName{
  color: var(--dfl-accent);
  font-weight: 600;
  font-size: 15px;
}

.dfl-latest__date{
  color: var(--dfl-dark);
  opacity: 0.7;
  font-weight: 400;
  margin-left: 4px;
}

/* -------------------------
   Responsive: Latest
   ------------------------- */

@media (max-width: 768px){
  .dfl-top__title{
    font-size: clamp(28px, 6vw, 36px);
  }

  .dfl-pop__grid{
    grid-template-columns: 1fr;
  }

  .dfl-pop__title{
    font-size: 20px;
  }

  /* Override base .dfl-latest__item – force stacked layout */
  .dfl-latest__item{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .dfl-latest__postTitle{
    font-size: 24px;
  }

  .dfl-latest__excerpt{
    font-size: 17px;
  }
}

