/*
Theme Name: Shimbun Press
Theme URI: https://newswire.asia/
Author: Asia Newsbeat
Author URI: https://newswire.asia/
Description: A flexible Japanese newspaper-inspired child theme for GeneratePress Premium.
Version: 2.10.0
Template: generatepress
Text Domain: shimbun-press
*/

:root {
    --sp-menu-font-family: Arial, sans-serif;
    --sp-menu-font-size: 13px;
    --sp-menu-font-weight: 600;
    --sp-menu-letter-spacing: 0px;
    --sp-menu-item-gap: 0px;
    --sp-logo-max-height: 44px;
    --sp-logo-max-width: 320px;
}

.site-header .inside-header {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 9px 28px;
}

.site-branding {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.site-branding .site-title,
.site-branding .site-description {
    margin-left: 0;
}

.site-branding .site-description {
    padding-left: 8px;
    border-left: 1px solid #ddd;
    line-height: 1.2;
}

.site-logo img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-height: var(--sp-logo-max-height);
    max-width: var(--sp-logo-max-width);
    object-fit: contain;
}

.site-logo a {
    display: block;
    line-height: 0;
}

.main-navigation .main-nav ul {
    font-family: var(--sp-menu-font-family);
}

.main-navigation .main-nav ul li a {
    font-family: var(--sp-menu-font-family);
    font-size: var(--sp-menu-font-size);
    font-weight: var(--sp-menu-font-weight);
    letter-spacing: var(--sp-menu-letter-spacing);
}

.main-navigation .main-nav > ul > li {
    margin-right: var(--sp-menu-item-gap);
}

.main-navigation .main-nav > ul > li:last-child {
    margin-right: 0;
}

.main-navigation .main-nav ul li a {
    padding-left: 10px;
    padding-right: 10px;
}

.sp-home {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 28px 60px;
}

.sp-section {
    margin: 0 0 34px;
}

.sp-section-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 14px;
    padding-bottom: 7px;
    border-bottom: 1px solid #222;
}

.sp-section-title h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
}

.sp-section-title a {
    font-size: 11px;
    color: #555;
    text-decoration: none;
}

.sp-lead-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 28px;
}

.sp-lead {
    border-bottom: 0;
    padding-bottom: 18px;
}

.sp-lead img,
.sp-story img {
    display: block;
    width: 100%;
    height: auto;
}

.sp-lead h1 {
    margin: 12px 0 7px;
    font-size: var(--sp-lead-title);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.sp-lead h1 a,
.sp-story h3 a {
    color: inherit;
    text-decoration: none;
}

.sp-lead .sp-meta,
.sp-story .sp-meta {
    color: #777;
    font-size: var(--sp-meta-size);
    margin-top: 8px;
}

.sp-lead .sp-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 10px;
}

.sp-side-stories {
    display: grid;
    gap: 18px;
}

.sp-story {
    min-width: 0;
}

.sp-story h3 {
    margin: 8px 0 0;
    font-size: 19px;
    line-height: 1.25;
}

.sp-story .sp-thumb {
    margin-bottom: 8px;
}

.sp-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.sp-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.sp-list {
    display: grid;
    gap: 0;
}

.sp-list .sp-list-item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    padding: 16px 0;
    border-bottom: 0;
}

.sp-list .sp-list-item:first-child {
    padding-top: 0;
}

.sp-list h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
}

.sp-category-label {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #777;
}

.sp-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    color: #555;
    text-decoration: none;
}

@media (max-width: 768px) {
    .site-header .inside-header {
        min-height: 58px;
        padding: 8px 16px;
    }

    .sp-home {
        padding: 22px 16px 45px;
    }

    .sp-lead-grid,
    .sp-grid-2,
    .sp-grid-3 {
        grid-template-columns: 1fr;
    }

    .sp-list .sp-list-item {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 12px;
    }

    .sp-list h3 {
        font-size: 17px;
    }
}

/* v2.3: editorial lead / Other Stories / access ranking */
.sp-lead-grid {
    grid-template-columns: minmax(0, 2fr) minmax(250px, .95fr);
    align-items: stretch;
}
.sp-lead-side {
    justify-content: space-between;
    min-height: 100%;
}
.sp-compact-story {
    grid-template-columns: var(--sp-other-thumb) minmax(0, 1fr);
    gap: 11px;
    padding: 0 0 14px;
    margin: 0;
}
.sp-compact-story .sp-media-16x9 {
    width: var(--sp-other-thumb);
    aspect-ratio: var(--sp-media-ratio);
}
.sp-compact-story h3 {
    margin: 0;
    font-size: var(--sp-lead-side-title);
    line-height: 1.38;
    font-weight: 700;
}
.sp-compact-story .sp-meta {
    display: none;
}

/* Other Stories: six posts, two columns, thumbnail left + headline right */
.sp-other-stories {
    border-top: 0;
    position: relative;
    margin-top: 8px;
}
.sp-other-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 26px;
}
.sp-other-item {
    display: grid;
    grid-template-columns: var(--sp-other-thumb) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid #ddd;
}
.sp-other-item .sp-media-16x9 {
    width: var(--sp-other-thumb);
    aspect-ratio: var(--sp-media-ratio);
}
.sp-other-item h3 {
    margin: 0;
    font-size: var(--sp-other-title);
    line-height: 1.35;
}
.sp-other-item .sp-meta {
    display: none;
}
.sp-other-copy {
    min-width: 0;
}

.sp-lead-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sp-lead-category {
    color: var(--sp-category-color);
    text-decoration: none;
    font-weight: 600;
}
.sp-lead-category:hover {
    text-decoration: underline;
}
.sp-meta-separator {
    color: #777;
}

/* Asahi-style access ranking: title + update time, red numbers, bold headlines */
.sp-ranking-section {
    border-top: 1px solid #222;
}
.sp-ranking-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0 9px;
    border-bottom: 1px solid #ddd;
}
.sp-ranking-heading h2 {
    margin: 0;
    font-size: var(--sp-ranking-title);
    line-height: 1.2;
    font-weight: 700;
}
.sp-ranking-heading h2::after {
    content: " ›";
    font-size: 18px;
    font-weight: 400;
}
.sp-ranking-heading span {
    color: #777;
    font-size: 10px;
    white-space: nowrap;
}
.sp-ranking {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sp-ranking li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 5px;
    padding: 12px 0;
    border-bottom: 0;
    align-items: start;
}
.sp-ranking .rank {
    color: #c40000;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 500;
}
.sp-ranking-copy a {
    display: block;
    color: #222;
    text-decoration: none;
    font-size: var(--sp-ranking-copy);
    line-height: 1.45;
    font-weight: 700;
}
.sp-ranking-copy a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .sp-other-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .sp-lead-grid {
        grid-template-columns: 1fr;
    }
    .sp-compact-story {
        grid-template-columns: 100px minmax(0, 1fr);
    }
    .sp-compact-story .sp-media-16x9 {
        width: 100px;
    }
}

/* v2.4: force every editorial image into a uniform 16:9 box */
.sp-home .sp-media-16x9,
.sp-home .sp-story .sp-thumb,
.sp-home .sp-story .sp-thumb a,
.sp-home .sp-lead > a,
.sp-home .sp-list-item > a {
    display: block;
    width: 100%;
    aspect-ratio: var(--sp-media-ratio);
    height: auto;
    overflow: hidden;
}

.sp-home .sp-media-16x9 img,
.sp-home .sp-story .sp-thumb img,
.sp-home .sp-story .sp-thumb a img,
.sp-home .sp-lead > a img,
.sp-home .sp-list-item > a img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

/* Keep the compact lead thumbnails at their intended fixed width. */
.sp-home .sp-compact-story .sp-media-16x9 {
    width: 112px;
    flex: 0 0 112px;
}

/* Keep Other Stories thumbnails fixed and uniform. */
.sp-home .sp-other-item .sp-media-16x9 {
    width: 112px;
    flex: 0 0 112px;
}

/* List thumbnails remain uniform even when GeneratePress/WP adds image sizing. */
.sp-home .sp-list .sp-list-item > a {
    width: 100%;
    aspect-ratio: var(--sp-media-ratio);
}

/* v2.5: ranking is a vertical sidebar block, not a full-width bottom section */
.sp-main-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 310px !important;
    gap: 34px !important;
    align-items: start !important;
}
.sp-sidebar {
    width: 100%;
    min-width: 0;
    align-self: start;
}
.sp-ranking {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.sp-ranking li {
    list-style: none !important;
}
.sp-ranking li::before {
    content: none !important;
}
.sp-ranking .rank {
    display: block;
}

/* Remove leftover GeneratePress title/header space on the homepage. */
body.home .entry-header,
body.front-page .entry-header {
    display: none !important;
}
body.home .site-content,
body.front-page .site-content {
    padding-top: 0 !important;
}
body.home .content-area,
body.front-page .content-area {
    margin-top: 0 !important;
}
body.home .inside-article,
body.front-page .inside-article {
    padding-top: 0 !important;
}

/* More balanced lead proportions. */
.sp-lead-grid {
    grid-template-columns: var(--sp-lead-columns) !important;
}
.sp-compact-story {
    grid-template-columns: var(--sp-lead-side-thumb) minmax(0, 1fr) !important;
}
.sp-compact-story .sp-media-16x9 {
    width: var(--sp-lead-side-thumb) !important;
    flex-basis: var(--sp-lead-side-thumb) !important;
}
@media (max-width: 900px) {
    .sp-main-layout {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 768px) {
    .sp-lead-grid {
        grid-template-columns: 1fr !important;
    }
}


/* v2.7: red editorial section headings, spacing, update ticker, weather and Taiwan time */
.sp-section-title h2 {
    color: var(--sp-section-heading-color);
}
.sp-other-stories .sp-section-title {
    margin-top: -20px;
    border-top: 1px solid #222;
    padding-top: 10px;
    margin-bottom: 16px;
}
.sp-update-ticker {
    border-top: 1px solid #222;
    border-bottom: 0;
    padding-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 30px 0 12px;
    min-height: 26px;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
}
.sp-update-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c40000;
    flex: 0 0 7px;
    animation: sp-update-blink 1s infinite;
}
.sp-update-label {
    color: #c40000;
    font-weight: 700;
    flex: 0 0 auto;
}
.sp-update-viewport {
    min-width: 0;
    height: 20px;
    overflow: hidden;
    position: relative;
    flex: 1;
}
.sp-update-items {
    position: relative;
    height: 20px;
}
.sp-update-item {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    opacity: 0;
    transform: translateY(100%);
    color: #222;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform .55s ease, opacity .55s ease;
}
.sp-update-item.is-active {
    top: 0;
    opacity: 1;
    transform: translateY(0);
}
.sp-update-item.is-leaving {
    top: 0;
    opacity: 0;
    transform: translateY(-100%);
}
.sp-update-item:hover { text-decoration: underline; }
@keyframes sp-update-blink { 50% { opacity: .25; } }

.sp-weather-section { margin-top: 28px; }
.sp-widget-heading {
    border-top: 1px solid #222;
    border-bottom: 1px solid #ddd;
    padding: 7px 0 8px;
}
.sp-widget-heading h2 {
    margin: 0;
    color: #222;
    font-size: 18px;
    line-height: 1.2;
}
.sp-weather-list { padding: 4px 0; }
.sp-weather-row {
    display: grid;
    grid-template-columns: 64px 30px 42px 45px minmax(0, 1fr);
    gap: 4px;
    align-items: center;
    min-height: 38px;
    border-bottom: 1px solid #eee;
    font-size: 11px;
}
.sp-weather-row:last-child { border-bottom: 0; }
.sp-weather-city { color: #333; font-size: 13px; font-weight: 400; }
.sp-weather-icon { font-size: 17px; text-align: center; }
.sp-weather-temp { color: #e65b00; font-size: 12px; font-weight: 600; }
.sp-weather-min { color: #3576a8; font-size: 11px; }
.sp-weather-pop { color: #555; text-align: left; font-size: 12px; white-space: nowrap; }
.sp-weather-pop-label { color: #777; font-size: 15px; }
.sp-weather-empty { padding: 8px 0; color: #777; font-size: 11px; line-height: 1.5; }

.sp-date-section { margin-top: 20px; }
.sp-date-widget {
    border: 1px solid #ddd;
    background: #fafafa;
}
.sp-date-widget-head {
    background: #eee;
    border-bottom: 1px solid #ddd;
    padding: 7px 9px;
    font-size: 14px;
    color: #555;
    letter-spacing: .04em;
}
.sp-date-widget-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
}
.sp-date-day {
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
    color: #222;
}
.sp-date-info { line-height: 1.45; flex: 1; }
.sp-date-lunar {
    margin-left: auto;
    min-width: 82px;
    padding-left: 12px;
    border-left: 1px solid #ddd;
    line-height: 1.5;
}
.sp-date-lunar-label { font-size: 15px; color: #555; font-weight: 600; }
.sp-date-lunar-value { font-size: 14px; color: #333; font-weight: 700; white-space: nowrap; }
.sp-date-y { font-size: 11px; color: #555; }
.sp-date-week { font-size: 12px; color: #222; font-weight: 600; }
.sp-date-clock { font-size: 17px; font-weight: 700; letter-spacing: .03em; }

/* v2.10: Update is the separator; do not draw another line below it. */
.sp-update-ticker { border-bottom: 0 !important; }
.sp-lead { border-bottom: 0 !important; }
