/*
Theme Name: KRUTO Media
Theme URI: https://krutomedia.example
Author: KRUTO Media
Description: Block theme for a pop-culture magazine. Hero section, 5 featured posts (custom block), latest posts feed, Substack subscription in the footer.
Version: 2.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kruto-media
*/

/* ============================================================
   HEADER
   ============================================================ */

.km-header {
    padding: 20px 40px;
    background: #F9F3DB;
    border-bottom: 3px solid #000000;
}

.km-header .wp-block-site-logo img {
    max-height: 60px;
    width: auto;
}

.km-header .wp-block-navigation {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-weight: 700;
    font-size: 20px;
    text-transform: uppercase;
}

.km-header .wp-block-navigation a {
    color: #000000;
    text-decoration: none;
}

.km-header .wp-block-navigation a:hover {
    color: #F03172;
}

/* Fixed header that slides in after the hero is scrolled past.
   The .km-header--auto class is added by JS only on pages that have .km-hero. */
.km-header--auto {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    transform: translateY(-100%);
    transition: transform 0.35s ease;
}

.km-header--auto.is-visible {
    transform: translateY(0);
}

body.admin-bar .km-header--auto {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .km-header--auto {
        top: 46px;
    }
}

/* ============================================================
   HERO
   ============================================================ */

.km-hero {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
}

.km-hero__side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    flex: none;
    width: 300px;
    min-height: 760px;
    padding: 40px;
    box-sizing: border-box;
    background: #000000;
    gap: 40px;
}

.km-hero__links {
    margin: 0;
    font-family: 'Jersey 20', monospace;
    font-weight: 400;
    font-size: 48px;
    line-height: 1;
    color: #F9F3DB;
}

.km-hero__links a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.km-hero__links a:hover {
    color: #F03172;
}

.km-hero__main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    min-height: 760px;
    padding: 50px 40px;
    box-sizing: border-box;
    gap: 29px;
    background: #F03172;
}

.km-hero__main .wp-block-site-logo,
.km-hero__main .wp-block-image {
    margin: 0;
}

.km-hero__main .wp-block-site-logo img,
.km-hero__main .wp-block-image img {
    width: min(800px, 100%);
    height: auto;
}

.km-hero__tagline {
    max-width: 680px;
    margin: 0;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-weight: 700;
    font-size: 32px;
    line-height: 38px;
    text-align: center;
    color: #F9F3DB;
}

@media (max-width: 900px) {
    .km-hero {
        flex-direction: column;
    }
    .km-hero__side {
        width: 100%;
        min-height: 0;
        gap: 32px;
        padding: 30px;
    }
    .km-hero__links {
        font-size: 36px;
    }
    .km-hero__main {
        min-height: 0;
        padding: 50px 24px;
    }
    .km-hero__tagline {
        font-size: 24px;
        line-height: 30px;
    }
}

/* ============================================================
   MARQUEE DIVIDER
   ============================================================ */

.km-marquee {
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 14px 0;
    background: #000000;
}

.km-marquee__track {
    display: flex;
    width: max-content;
    animation: km-marquee 30s linear infinite;
}

.km-marquee__track span {
    display: block;
    white-space: nowrap;
    font-family: 'Jersey 20', monospace;
    font-weight: 400;
    font-size: 56px;
    line-height: 1;
    color: #F9F3DB;
}

@keyframes km-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .km-marquee__track {
        animation: none;
    }
}

@media (max-width: 900px) {
    .km-marquee__track span {
        font-size: 40px;
    }
}

/* ============================================================
   ARCHIVE (category / tag pages) — static black band with title
   ============================================================ */

.km-archive-band {
    width: 100%;
    padding: 14px 40px;
    background: #000000;
    box-sizing: border-box;
}

.km-archive-title {
    margin: 0;
    font-family: 'Jersey 20', monospace;
    font-weight: 400;
    font-size: 56px;
    line-height: 1;
    color: #F9F3DB;
}

@media (max-width: 900px) {
    .km-archive-band {
        padding: 14px 20px;
    }
    .km-archive-title {
        font-size: 40px;
    }
}

/* ============================================================
   LATEST FEED
   ============================================================ */

.km-latest {
    padding: 40px;
}

/* Masonry: three independent columns, cards flow down each one */
.km-latest .wp-block-post-template {
    display: block;
    columns: 3;
    column-gap: 40px;
}

.km-latest .wp-block-post-template > li {
    display: block;
    width: 100%;
    margin: 0 0 45px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.km-latest .wp-block-post-featured-image {
    margin: 0 0 12px;
}

.km-latest .wp-block-post-featured-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Editorial rhythm: mix of landscape, portrait and square cards */
.km-latest .wp-block-post-template > li:nth-of-type(5n+1) .wp-block-post-featured-image img,
.km-latest .wp-block-post-template > li:nth-of-type(5n+4) .wp-block-post-featured-image img {
    aspect-ratio: 3 / 4;
}

.km-latest .wp-block-post-template > li:nth-of-type(5n+3) .wp-block-post-featured-image img {
    aspect-ratio: 1 / 1;
}

/* Category (left) and tag (right) above the title */
.km-latest .km-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 8px;
}

.km-latest .wp-block-post-terms {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #000000;
}

.km-latest .wp-block-post-terms a {
    color: #000000;
    text-decoration: none;
}

.km-latest .wp-block-post-terms a:hover {
    color: #F03172;
}

.km-latest .wp-block-post-title {
    margin: 0;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 23px;
    text-align: center;
}

@media (max-width: 900px) {
    .km-latest {
        padding: 20px;
    }
    .km-latest .wp-block-post-template {
        columns: 2;
        column-gap: 20px;
    }
}

@media (max-width: 600px) {
    .km-latest .wp-block-post-template {
        columns: 1;
    }
}

.km-latest .wp-block-post-title a {
    color: #000000;
    text-decoration: none;
}

.km-latest .wp-block-post-title a:hover {
    color: #F03172;
}

.km-latest .wp-block-query-pagination {
    margin-top: 40px;
    font-family: 'Jersey 20', monospace;
    font-size: 28px;
    justify-content: center;
}

.km-latest .wp-block-query-pagination a,
.km-latest .wp-block-query-pagination .page-numbers {
    color: #000000;
    text-decoration: none;
}

.km-latest .wp-block-query-pagination a:hover {
    color: #F03172;
}

/* ============================================================
   SINGLE POST / PAGE
   ============================================================ */

.km-single {
    padding: 60px 24px;
}

.km-single .wp-block-post-title {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-weight: 700;
    text-align: center;
}

.km-single .wp-block-post-date {
    display: block;
    text-align: center;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    color: #666666;
}

/* ============================================================
   FOOTER
   ============================================================ */

.km-footer {
    padding: 60px 40px;
    background: #000000;
    color: #F9F3DB;
    text-align: center;
}

.km-footer__title {
    margin: 0 0 24px;
    font-family: 'Jersey 20', monospace;
    font-weight: 400;
    font-size: 48px;
    line-height: 1;
    color: #F9F3DB;
}

.km-footer iframe {
    max-width: 100%;
}

.km-footer__credit {
    margin: 40px 0 0;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 16px;
    color: #F9F3DB;
}
