/*
 * Additive stylesheet.
 * only layers new `hn-*` classes on top of the existing theme.
 * Tokens below mirror the site's compiled values (style.scss $primary-color: #E72463).
 */

:root {
    /* Color */
    --hn-paper: #ffffff;
    --hn-paper-soft: #f7f7f7;
    --hn-ink: #484848;
    --hn-ink-strong: #1a1a1a;
    --hn-ink-soft: #7a7a7a;
    --hn-accent: #e72463;
    --hn-accent-soft: #fdeef3;
    --hn-line: #e8e8e8;
    --hn-overlay: rgba(26, 26, 26, 0.72);

    /* Type */
    --hn-font-display: "Josefin Slab", Georgia, serif;
    --hn-font-body: "Poppins", system-ui, sans-serif;
    --hn-font-script: "Allura", cursive;

    /* Space (4 pt scale) */
    --hn-space-1: 4px;
    --hn-space-2: 8px;
    --hn-space-3: 12px;
    --hn-space-4: 16px;
    --hn-space-5: 24px;
    --hn-space-6: 32px;
    --hn-space-7: 48px;

    /* Shape + motion */
    --hn-radius: 4px;
    --hn-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --hn-dur: 320ms;
}

/* No horizontal scroll floor (mobile safety) */
html,
body {
    overflow-x: clip;
}

/* ============================================================
   List page — story cards
   ============================================================ */

.hn-list-area {
    background: var(--hn-paper);
}

.hn-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--hn-radius);
    background: var(--hn-paper);
}

.hn-card-media {
    position: relative;
    overflow: hidden;
}

.hn-card-img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform var(--hn-dur) var(--hn-ease-out);
}

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

.hn-chip {
    position: absolute;
    top: var(--hn-space-3);
    left: var(--hn-space-3);
    z-index: 2;
    display: inline-block;
    padding: 4px var(--hn-space-3);
    background: var(--hn-accent);
    color: var(--hn-paper);
    font-family: var(--hn-font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--hn-radius);
}

.hn-photo-count {
    position: absolute;
    right: var(--hn-space-3);
    bottom: var(--hn-space-3);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px var(--hn-space-2);
    background: var(--hn-overlay);
    color: var(--hn-paper);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--hn-radius);
}

.hn-card-title a {
    color: var(--hn-ink-strong);
}

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

.hn-card .blog-content {
    flex: 1 1 auto;
}

.hn-empty {
    padding: var(--hn-space-7) var(--hn-space-4);
    background: var(--hn-paper-soft);
    border-radius: var(--hn-radius);
}

.hn-empty .desc-content {
    margin-bottom: 0;
}

/* ============================================================
   Detail page — story
   ============================================================ */

.hn-detail-area {
    background: var(--hn-paper);
}

/* Center the detail column — self-sufficient (BS5 dropped ml-auto/mr-auto) */
.hn-col-center {
    margin-left: auto;
    margin-right: auto;
}

.hn-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--hn-space-2);
    font-size: 13px;
    color: var(--hn-ink-soft);
    margin-bottom: var(--hn-space-6);
}

.hn-breadcrumb a {
    color: var(--hn-accent);
}

.hn-breadcrumb a:hover {
    text-decoration: underline;
}

.hn-breadcrumb-sep {
    color: var(--hn-line);
}

.hn-story-head {
    max-width: 46rem;
    margin: 0 auto;
    text-align: center;
}

.hn-chip--center {
    position: static;
    display: inline-block;
}

.hn-story-title {
    font-family: var(--hn-font-display);
    font-weight: 600;
    font-size: 44px;
    line-height: 1.15;
    color: var(--hn-ink-strong);
    margin: var(--hn-space-4) 0 var(--hn-space-2);
    overflow-wrap: anywhere;
    min-width: 0;
}

.hn-story-meta {
    color: var(--hn-ink-soft);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0;
}

.hn-story-body {
    max-width: 46rem;
    margin: var(--hn-space-6) auto 0;
    font-family: var(--hn-font-body);
    color: var(--hn-ink);
    font-size: 16px;
    line-height: 1.85;
    text-align: justify;
}

.hn-story-body > p:first-child {
    font-size: 18px;
    color: var(--hn-ink-strong);
}

/* ============================================================
   Detail page — photo gallery (single or multiple)
   ============================================================ */

.hn-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hn-space-4);
    margin-top: var(--hn-space-7);
}

.hn-gallery[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
}

.hn-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: var(--hn-radius);
    background: var(--hn-paper-soft);
}

.hn-gallery-item img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform var(--hn-dur) var(--hn-ease-out), opacity var(--hn-dur) var(--hn-ease-out);
}

.hn-gallery-item:hover img {
    transform: scale(1.03);
    opacity: 0.92;
}

.hn-gallery-item.is-lead {
    grid-column: 1 / -1;
}

.hn-gallery-item.is-lead img {
    height: 420px;
}

/* Single photo — show the full image, no crop */
.hn-gallery[data-count="1"] .hn-gallery-item img {
    height: auto;
    max-height: 560px;
    object-fit: contain;
}

.hn-story-footer {
    margin-top: var(--hn-space-7);
}

.hn-back-btn {
    font-size: 14px;
}

.hn-back-btn i {
    margin-right: var(--hn-space-2);
}

/* ============================================================
   Focus rings (always instant, >= 3:1)
   ============================================================ */

.hn-card-media a:focus-visible,
.hn-gallery-item:focus-visible,
.hn-breadcrumb a:focus-visible,
.hn-back-btn:focus-visible {
    outline: 2px solid var(--hn-accent);
    outline-offset: 3px;
}

/* ============================================================
   Responsive — 768 / 414 / 375 / 320
   ============================================================ */

@media (max-width: 767px) {
    .hn-story-title {
        font-size: 34px;
    }

    .hn-gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .hn-gallery-item.is-lead {
        grid-column: auto;
    }

    .hn-gallery-item img,
    .hn-gallery-item.is-lead img {
        height: 220px;
    }

    .hn-gallery[data-count="1"] .hn-gallery-item img {
        height: auto;
        max-height: 420px;
    }
}

@media (max-width: 479px) {
    .hn-card-img {
        height: 200px;
    }

    .hn-story-body {
        font-size: 15px;
        line-height: 1.75;
    }

    .hn-story-body > p:first-child {
        font-size: 16px;
    }

    .hn-story-title {
        font-size: 28px;
    }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .hn-card-img,
    .hn-gallery-item img {
        transition: none;
    }

    .hn-card:hover .hn-card-img,
    .hn-gallery-item:hover img {
        transform: none;
        opacity: 1;
    }
}
