/* ==========================================================================
   KUKUNET — Homepage styles
   ========================================================================== */

:root {
    --primary: #123b65;
    --primary-dark: #0b2948;
    --primary-darker: #091e34;
    --accent: #e5a52b;
    --accent-dark: #9a701e;
    --text: #202a36;
    --muted: #5b6b7e;      /* bumped from #718096 for 4.5:1 on white */
    --border: #e8edf2;
    --light: #f5f7fa;
    --white: #ffffff;
    --danger: #bd3030;
    --focus: #2f6fbf;
}

* { box-sizing: border-box; }

body {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Visible focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 2px;
}

.serif { font-family: 'Playfair Display', Georgia, serif; }

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary-dark);
    color: #fff;
    padding: 10px 16px;
    z-index: 9999;
    font-weight: 700;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    left: 0;
}

/* ---------------- Topbar ---------------- */
.topbar {
    background: var(--primary-dark);
    color: #dce6f0;
    font-size: 12px;
    padding: 8px 0;
}
.topbar a:hover { color: var(--accent); }

/* ---------------- Masthead ---------------- */
.masthead { padding: 22px 0; border-bottom: 1px solid var(--border); }

.brand-name {
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -1.2px;
    color: var(--primary);
    line-height: 1.1;
}
.brand-name span { color: var(--accent); }

.brand-tagline {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 5px;
}

.header-search { max-width: 290px; position: relative; }
.header-search input {
    border-radius: 30px;
    padding: 10px 42px 10px 18px;
    border: 1px solid var(--border);
    font-size: 13px;
}
.header-search button {
    position: absolute;
    right: 8px;
    top: 5px;
    border: none;
    background: none;
    color: var(--primary);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------------- Nav ---------------- */
.main-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.main-nav .nav-link {
    font-size: 13px;
    font-weight: 700;
    color: #344256;
    padding: 16px 12px;
    white-space: nowrap;
}
.main-nav .nav-link:hover,
.main-nav .nav-link:focus { color: var(--primary); }
.main-nav .nav-link.active {
    color: var(--primary);
    border-bottom: 3px solid var(--accent);
}

/* ---------------- Breaking news ---------------- */
.breaking-wrap { padding: 17px 0; }

.breaking-label {
    background: var(--danger);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 8px 13px;
    text-transform: uppercase;
    letter-spacing: .8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.breaking-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.breaking-track {
    display: inline-flex;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    animation: ticker 40s linear infinite;
    will-change: transform;
}
.breaking-viewport:hover .breaking-track,
.breaking-viewport:focus-within .breaking-track {
    animation-play-state: paused;
}

.breaking-track a {
    display: inline-block;
    padding-left: 22px;
}
.breaking-track a::before {
    content: "•";
    color: var(--accent);
    margin-right: 12px;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .breaking-track { animation: none; }
    .breaking-viewport { overflow-x: auto; }
}

/* ---------------- Section headings ---------------- */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 22px;
    padding-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}
.section-heading h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(19px, 2.5vw, 23px);
    font-weight: 700;
    margin: 0;
}
.section-heading a {
    font-size: 12px;
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

/* ---------------- Hero ---------------- */
.hero-section { padding: 24px 0 40px; }

.hero-main {
    position: relative;
    min-height: 440px;
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
    background: #172c42;
    display: block;
}
.hero-main img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}
.hero-main:hover img { transform: scale(1.04); }
.hero-main::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 10%, rgba(0,0,0,.88));
}
.hero-content {
    position: absolute;
    z-index: 2;
    bottom: 0;
    padding: 30px;
    color: #fff;
    max-width: 750px;
}
.category-label {
    background: var(--accent);
    color: #172c42;
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 9px;
    margin-bottom: 12px;
}
.hero-content h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(24px, 3.5vw, 43px);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-content p {
    font-size: 14px;
    color: #e2e8f0;
    max-width: 600px;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta { font-size: 11px; color: #d2d9e2; }

/* Side stories */
.side-story {
    display: flex;
    gap: 14px;
    padding-bottom: 17px;
    margin-bottom: 17px;
    border-bottom: 1px solid var(--border);
}
.side-story:last-child { border-bottom: 0; margin-bottom: 0; }
.side-story img {
    width: 112px;
    height: 88px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.side-story h3 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 7px;
}

.story-category {
    color: var(--accent-dark);
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .7px;
}
.story-date { font-size: 11px; color: var(--muted); }

/* ---------------- Cards ---------------- */
.content-section { padding: 35px 0; }

.news-card {
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    height: 100%;
    transition: transform .25s, box-shadow .25s;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(20,45,70,.09);
}
.news-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.news-card-body { padding: 17px; }
.news-card h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    margin: 8px 0;
}
.news-card p {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 12px;
}
.news-meta { font-size: 11px; color: var(--muted); }

/* Latest list */
.latest-item {
    display: flex;
    gap: 17px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.latest-item img {
    width: 145px;
    height: 105px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.latest-item h3 {
    font-size: 17px;
    line-height: 1.4;
    font-weight: 700;
    margin: 5px 0;
}

/* Sidebar */
.sidebar-box {
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 5px;
}
.popular-item {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.popular-item:last-child { border-bottom: none; }
.popular-number {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 27px;
    font-weight: 700;
    color: #c5d1de;
    line-height: 1;
}
.popular-item h3 {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    margin: 3px 0;
}

/* ---------------- Video ---------------- */
.video-section {
    background: var(--primary-dark);
    color: #fff;
    padding: 45px 0;
}
.video-section .section-heading { border-color: var(--accent); }
.video-section .section-heading h2 { color: #fff; }
.video-feature {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    background: #000;
}
.video-feature video { width: 100%; display: block; max-height: 430px; }
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    color: var(--primary);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    pointer-events: none;
}
.video-card { position: relative; margin-bottom: 17px; }
.video-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
}
.video-card h3 {
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

/* ---------------- Categories ---------------- */
.category-section { padding: 40px 0; background: var(--light); }
.category-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    height: 100%;
}
.category-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.category-card-body { padding: 15px; }
.category-card h3 { font-size: 15px; font-weight: 700; line-height: 1.4; }
.category-card .category-title {
    font-size: 11px;
    color: var(--accent-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 9px;
}

/* ---------------- Newsletter ---------------- */
.newsletter { background: #eef3f8; padding: 48px 20px; text-align: center; }
.newsletter h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
}
.newsletter p { color: var(--muted); font-size: 14px; }
.newsletter-form {
    max-width: 480px;
    margin: 20px auto 0;
    display: flex;
    gap: 8px;
}
.newsletter-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d6dee7;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
}
.newsletter-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
}
.newsletter-form button:hover { background: var(--primary-dark); }

/* ---------------- Footer ---------------- */
.site-footer {
    background: var(--primary-darker);
    color: #c7d2df;
    padding: 55px 0 20px;
}
.site-footer .brand-name { color: #fff; }
.site-footer h4 {
    font-size: 14px;
    color: #fff;
    font-weight: 800;
    margin-bottom: 17px;
}
.site-footer p,
.site-footer li,
.site-footer a { font-size: 12px; color: #b6c4d3; }
.site-footer li { margin-bottom: 9px; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid #263b50;
    margin-top: 35px;
    padding-top: 18px;
    font-size: 11px;
    gap: 8px;
}

/* ---------------- Badges ---------------- */
.demo-label {
    font-size: 9px;
    color: #7a4f00;
    background: #fff1cf;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 800;
    display: inline-block;
    letter-spacing: .5px;
}
.empty-message {
    color: var(--muted);
    padding: 30px 15px;
    text-align: center;
    background: var(--light);
    border-radius: 5px;
}

/* ---------------- Back to top ---------------- */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    z-index: 999;
    border: none;
}
.back-to-top.is-visible { display: flex; }

/* ---------------- Responsive ---------------- */
@media (max-width: 767px) {
    .masthead { padding: 16px 0; }
    .header-search { margin-top: 15px; max-width: 100%; }
    .hero-main { min-height: 380px; }
    .hero-content { padding: 20px; }
    .latest-item img { width: 105px; height: 90px; }
    .latest-item h3 { font-size: 14px; }
    .newsletter-form { flex-direction: column; }
    .topbar .social-links { display: none; }
}
.video-feature video,
.video-card video {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
    border-radius: 8px;
}

.video-feature video {
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.video-card video {
    aspect-ratio: 16 / 9;
    object-fit: contain;
}