/* The Deltan — home page. Values measured from Elementor page 7 and loop templates 2124/2149/2131/2145/1095/1126. */

.home-main {
    /* The old theme (Astra) set the root font size to 15px, and 13.68px from 921px down;
       Elementor's rem/em sizes followed it. --rem keeps those sizes without touching <html>. */
    --rem: 15px;
    --home-black: #000;
    --lh: calc(var(--rem) * 1.65); /* Astra's body line-height, inherited as a fixed length */
    font-size: var(--rem);
    line-height: var(--lh);
    color: var(--deltan-text);
    overflow-wrap: break-word; /* Astra's .entry-content did this; long words wrap in the narrow tablet columns */
}
@media (max-width: 921px) {
    .home-main { --rem: 13.68px; }
}
.home-main h2, .home-main h3, .home-main p, .home-main ul, .home-main figure { margin: 0; padding: 0; }
.home-main ul { list-style: none; }
.home-main a { color: inherit; }
.home-wrap { max-width: var(--deltan-width); margin-left: auto; margin-right: auto; }

/* ---------- Section heading with parallelogram rule ---------- */
.home-heading { display: flex; align-items: center; padding: 10px 0; }
.home-heading::before,
.home-heading::after {
    content: ""; flex: 1 1 0; min-height: 5px; background-color: var(--deltan-red);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' overflow='visible' height='100%25' viewBox='0 0 24 24' fill='black' stroke='none'%3E%3Cpolygon points='9.4,2 24,2 14.6,21.6 0,21.6'/%3E%3C/svg%3E") 0 0 / 8.6px 100% repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' overflow='visible' height='100%25' viewBox='0 0 24 24' fill='black' stroke='none'%3E%3Cpolygon points='9.4,2 24,2 14.6,21.6 0,21.6'/%3E%3C/svg%3E") 0 0 / 8.6px 100% repeat-x;
}
.home-main .home-heading__text {
    margin: 0 10px; max-width: 95%;
    font: 600 calc(var(--rem) * 2)/1 var(--font-heading); color: var(--deltan-red);
}
.home-heading--plain::before,
.home-heading--plain::after { min-height: 0; background: none; -webkit-mask: none; mask: none; }
@media (max-width: 1024px) {
    .home-heading { padding: 1px 0; }
}

/* ---------- Top section ---------- */
.home-top { display: flex; flex-wrap: wrap; align-items: stretch; padding-top: var(--rem); }
.home-top__main { width: 70%; padding: 10px; display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.home-top__more { width: 30%; padding: 10px; min-width: 0; }
.home-top__brief { width: 100%; padding: 10px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.home-top__side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }

/* Lead story */
.home-lead { display: flex; flex-direction: column; gap: 20px; }
.home-lead__figure { font-size: var(--rem); line-height: var(--lh); }
/* Inline-block, as in the Elementor image widget: the line's descender space sits under the image. */
.home-lead__figure a { display: inline-block; width: 100%; vertical-align: baseline; }
.home-lead__image { width: 100%; height: 451px; object-fit: cover; }
.home-lead__caption {
    margin: 0 0 .8075em; text-align: right;
    font: 400 11px/var(--lh) var(--font-ui); color: var(--deltan-text);
}
.home-lead__body { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.home-main .home-lead__title { font: 600 32px/1.3 var(--font-heading); color: var(--home-black); }
.home-lead__excerpt { font: 300 calc(var(--rem) * 1.25)/var(--lh) var(--font-ui); color: var(--deltan-text); }
.home-lead__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; font: 300 var(--rem)/var(--lh) var(--font-ui); }
.home-lead__byline { font-weight: 500; color: var(--deltan-red); }
.home-lead__date { color: var(--deltan-text); }

/* Side stories */
.home-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.home-side__media { display: block; }
.home-side__image { width: 100%; height: 250px; object-fit: cover; object-position: center; }
.home-side__body { display: flex; flex-direction: column; gap: 10px; }
.home-side__cats { font: 600 var(--rem)/1.25 var(--font-heading); color: var(--deltan-red); }
.home-main .home-side__title { font: 600 19px/1.3 var(--font-heading); color: var(--home-black); }

/* The old global rule: headings turn red on hover. */
.home-lead__title:hover, .home-side__title:hover, .home-more__heading:hover,
.home-voices__heading:hover, .home-listen__title:hover,
.home-more__item a:hover .home-more__cat { color: var(--deltan-red); }

/* MORE STORIES */
.home-main .home-more__heading { padding-left: 10px; margin-bottom: 20px; font: 500 calc(var(--rem) * 1.6)/1.2 var(--font-ui); color: var(--home-black); }
.home-more { display: grid; row-gap: 15px; }
.home-more__item a { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.home-more__cat { font: 600 1.35em/1.2 var(--font-ui); color: var(--deltan-red); }
.home-more__title { font: 400 calc(var(--rem) * 1.3333)/1.2 var(--font-heading); color: var(--deltan-text); }

/* ---------- Carousels ---------- */
.home-carousel { position: relative; }
.home-carousel--explore .home-carousel__track { --per-view: 5; }
.home-carousel__track {
    --gap: 10px;
    display: flex; gap: var(--gap); overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
}
.home-carousel--stories .home-carousel__track { --per-view: 3; }
.home-carousel__track::-webkit-scrollbar { display: none; }
.home-carousel__track:focus-visible { outline: 2px solid var(--deltan-red); outline-offset: 2px; }
.home-carousel__slide {
    flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--gap)) / var(--per-view));
    scroll-snap-align: start; min-width: 0;
}
.home-carousel__controls { position: relative; display: flex; align-items: flex-start; justify-content: center; height: 16px; }
.home-carousel__dots { display: flex; align-items: center; justify-content: center; padding-top: 10px; }
.home-carousel__dot {
    width: 6px; height: 6px; margin: 0 6px; padding: 0; border: 0; border-radius: 50%;
    background: #000; opacity: .2; cursor: pointer;
}
.home-carousel__dot[aria-current="true"] { opacity: 1; }
.home-carousel__dot:focus-visible { outline: 2px solid var(--deltan-red); outline-offset: 3px; }
/* Previous / next are for keyboard and screen-reader users: the original showed bullets only. */
.home-carousel__arrow {
    position: absolute; top: 4px; padding: 2px 8px; border: 1px solid currentColor; border-radius: 3px;
    background: #fff; color: var(--deltan-text); font: 500 12px/1.4 var(--font-ui); cursor: pointer;
    opacity: 0; pointer-events: none;
}
.home-carousel__arrow[data-carousel-prev] { left: 0; }
.home-carousel__arrow[data-carousel-next] { right: 0; }
.home-carousel__arrow:focus-visible { opacity: 1; pointer-events: auto; }
/* Swiper changed slide counts at 1024 and 767 inclusive, one pixel off the CSS breakpoints. */
@media (max-width: 1023px) {
    .home-carousel--stories .home-carousel__track { --per-view: 2; }
}
@media (max-width: 766px) {
    .home-carousel--stories .home-carousel__track,
    .home-carousel--explore .home-carousel__track { --per-view: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .home-carousel__track { scroll-behavior: auto; }
}

/* Story tile (News In Brief, Latest Stories) */
.home-tile {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end;
    min-height: 350px; height: 100%; padding: 10px; overflow: hidden; background: #000;
}
.home-tile__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-tile::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: #000; opacity: .5; transition: background-color .5s, opacity .5s;
}
.home-tile:hover::before, .home-tile:focus-visible::before { background: var(--deltan-red-dark); opacity: .74; }
.home-tile__body { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 5px; color: #fff; }
.home-tile__title { font: 600 calc(var(--rem) * 1.6)/1 var(--font-heading); text-transform: capitalize; }
.home-tile__rule { width: 10%; border-top: 1px solid #fff; }
.home-tile__date { font: 400 calc(var(--rem) * 1.0667)/1.25 var(--font-ui); }
@media (max-width: 1024px) {
    .home-tile { min-height: 240px; }
}

/* ---------- Cartoon ---------- */
/* Elementor "boxed" containers: 10px outside the 1200px box plus 10px inside it. */
.home-cartoon { margin-top: 20px; padding: 20px; max-width: calc(var(--deltan-width) + 20px); }
.home-cartoon__image { width: 100%; height: auto; }

/* ---------- Latest Stories ---------- */
.home-latest { margin-top: 40px; padding: 10px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Listen To Today's Conversation ---------- */
.home-listen { margin-top: 40px; padding: 20px; max-width: calc(var(--deltan-width) + 20px); display: flex; flex-direction: column; gap: 20px; }
.home-listen__frame { padding: 0 calc(var(--rem) * 5); }
.home-listen__card {
    display: flex; flex-wrap: wrap; padding: 10px;
    border: 1px solid var(--deltan-body); border-radius: 5px;
}
.home-listen__art { width: 12.165%; padding: 10px; }
.home-listen__art img { width: 100px; max-width: none; height: 100px; margin: 0 auto; object-fit: cover; object-position: center; }
.home-listen__info { width: 87.835%; padding: 10px; display: flex; flex-direction: column; gap: 20px; }
.home-listen__logo { display: block; }
.home-listen__logo img { width: 120px; height: auto; }
.home-main .home-listen__title { font: 400 26px/1.3 var(--font-ui); color: var(--deltan-text); }
/* 10px column padding plus the old 1.6em margin under the player. */
.home-listen__player { width: 100%; padding: 10px 10px calc(10px + var(--rem) * 1.6); }
/* Audio player: a dependency-free copy of the old dark MediaElement bar (40px, #222, 10px rail). */
.home-audio__media { display: block; width: 100%; }
.home-audio.is-enhanced .home-audio__media { display: none; }
.home-audio__bar { display: flex; align-items: center; height: 40px; padding: 0 10px; background: #222; color: #fff; }
.home-audio__bar[hidden] { display: none; }
.home-audio__button {
    flex: none; display: block; width: 20px; height: 20px; margin: 10px 6px; padding: 0;
    border: 0; background: none; color: #fff; cursor: pointer;
}
.home-audio__icon { display: block; width: 20px; height: 20px; }
.home-audio__icon--pause, .home-audio.is-playing .home-audio__icon--play { display: none; }
.home-audio.is-playing .home-audio__icon--pause { display: block; }
.home-audio.is-muted .home-audio__waves { opacity: .25; }
.home-audio__time { flex: none; padding: 0 6px; font: 700 11px/1 Helvetica, Arial, sans-serif; font-variant-numeric: tabular-nums; }
.home-audio__range {
    --p: 0%; --fill: rgba(255, 255, 255, .9); --rest: rgba(255, 255, 255, .33);
    -webkit-appearance: none; appearance: none; display: block; min-width: 0; margin: 0; padding: 0;
    border-radius: 2px; background: linear-gradient(to right, var(--fill) var(--p), var(--rest) var(--p)); cursor: pointer;
}
.home-audio__seek { flex: 1 1 auto; height: 10px; margin: 0 10px; }
.home-audio__volume { --p: 100%; --fill: #fff; --rest: rgba(50, 50, 50, .8); flex: none; width: 50px; height: 8px; margin: 0 6px 0 0; }
.home-audio__range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.home-audio__range::-moz-range-track { height: 100%; background: transparent; }
.home-audio__range::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 100%; border: 0; border-radius: 2px; background: #fff; opacity: 0; }
.home-audio__range::-moz-range-thumb { width: 10px; height: 100%; border: 0; border-radius: 2px; background: #fff; opacity: 0; }
.home-audio__range:hover::-webkit-slider-thumb, .home-audio__range:focus-visible::-webkit-slider-thumb { opacity: 1; }
.home-audio__range:hover::-moz-range-thumb, .home-audio__range:focus-visible::-moz-range-thumb { opacity: 1; }
.home-audio__button:focus-visible, .home-audio__range:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 1024px) {
    .home-listen__art { width: 20%; }
    .home-listen__info { width: 80%; }
}
@media (max-width: 921px) {
    .home-main .home-listen__title { font-size: 20px; }
}

/* ---------- Columnists + Featured Voices ---------- */
.home-voices { margin-top: 40px; padding-top: var(--rem); display: flex; flex-wrap: wrap; }
.home-voices__columnists { width: 70%; padding: 10px; min-width: 0; }
.home-voices__columnists .home-heading { margin-bottom: 20px; }
.home-voices__featured { width: 30%; padding: calc(var(--rem) * .7) 0 0; min-width: 0; }
.home-columnists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 35px 30px; }
.home-columnist a { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 20px; text-align: center; }
.home-columnist__image { width: 200px; height: 200px; max-width: none; border-radius: 50%; object-fit: cover; object-position: center; }
.home-columnist a:hover .home-columnist__image { filter: saturate(0); }
.home-columnist__author, .home-voice__author { font: 600 1.35em/1.2 var(--font-ui); color: var(--deltan-red); }
.home-columnist__title { font: 400 calc(var(--rem) * 1.3333)/1.2 var(--font-heading); color: var(--deltan-text); }
.home-columnist__title { margin-top: calc(var(--rem) * -1.5); }
.home-main .home-voices__heading {
    padding-left: calc(var(--rem) * .65); margin-bottom: 20px;
    font: 600 32px/1.3 var(--font-heading); color: var(--deltan-red);
}
.home-voice { padding: 10px; }
.home-main .home-voice__author { margin-bottom: 20px; }
.home-main .home-voice__title { margin-top: calc(var(--rem) * -1.5); font: 400 calc(var(--rem) * 1.3333)/1.2 var(--font-heading); color: var(--deltan-text); }
.home-voice__title:hover { color: var(--deltan-red); }

/* ---------- Explore More ---------- */
.home-explore { margin-top: 40px; padding: 10px; display: flex; flex-direction: column; gap: 20px; }
.home-explore__tile { position: relative; display: block; height: 470px; overflow: hidden; }
.home-carousel--explore .home-carousel__controls { height: 30px; align-items: center; }
.home-carousel--explore .home-carousel__dots { padding-top: 0; }
.home-explore__image { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-explore__label {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(158, 0, 0, .71); color: #fff; text-align: center;
    font: 600 calc(var(--rem) * 1.5)/var(--lh) var(--font-heading);
    opacity: 0; transition: opacity .5s;
}
.home-explore__tile:hover .home-explore__label,
.home-explore__tile:focus-visible .home-explore__label { opacity: 1; }
@media (max-width: 1024px) {
    .home-explore__tile { height: 270px; }
}
@media (max-width: 767px) {
    .home-explore__tile { height: 470px; }
}

/* ---------- Featured Stories ---------- */
/* The old footer sat 10px closer: its logo was 81px below the last story line, where the shared
   footer's 60px margin plus 20px brand padding would give 91px. Both margins collapse, so trim both. */
.home-featured { margin-top: 40px; margin-bottom: 50px; display: flex; flex-wrap: wrap; }
.home-main + .site-footer { margin-top: 50px; }
.home-featured__heading { width: 100%; padding: 10px; }
.home-featured__main { width: 70%; padding: 10px; min-width: 0; }
.home-featured__side { width: 30%; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; align-content: start; min-width: 0; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
    /* As before: below desktop a side-story image is never wider than its height allows
       (200px x its aspect ratio), and sits centred when the column is wider than that. */
    .home-side__image { width: auto; max-width: 100%; height: 200px; margin: 0 auto; }
    .home-more__item a { gap: 20px; }
    .home-more__cat, .home-columnist__author, .home-voice__author { font-size: 1.15em; }
    .home-more__title { font-size: 1em; margin-top: -1em; }
    .home-columnist__image { width: 120px; height: 120px; }
    .home-columnist a { padding: 10px; }
    .home-columnist__title, .home-main .home-voice__title { font-size: 1em; margin-top: -1em; }
    .home-featured__side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .home-lead__image { height: 300px; }
}
@media (max-width: 921px) {
    .home-main .home-lead__title, .home-main .home-voices__heading { font-size: 25px; }
}

/* ---------- Phone ---------- */
@media (max-width: 767px) {
    .home-top { gap: 20px; }
    .home-top__main, .home-top__more, .home-top__brief,
    .home-voices__columnists, .home-voices__featured,
    .home-featured__main, .home-featured__side { width: 100%; }
    .home-top__more { order: 3; }
    .home-top__side, .home-featured__side { grid-template-columns: minmax(0, 1fr); }
    .home-lead__image { height: 225px; }
    .home-side { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 0; }
    .home-side__media { width: 30%; }
    .home-side__image { height: 100px; }
    .home-side__body { width: 65%; }
    .home-side__cats { font-size: calc(var(--rem) * .95); }
    .home-cartoon { margin-top: 0; }
    .home-heading--center-mobile { justify-content: center; }
    .home-heading--center-mobile .home-heading__text { text-align: center; }
    .home-listen__frame { padding: 0; }
    .home-listen__art { width: 38%; }
    .home-listen__info { width: 62%; }
    .home-main .home-listen__title { font-size: calc(var(--rem) * 1.15); }
    .home-columnists { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
    .home-columnist__image { width: 150px; height: 150px; }
}
