/*
Theme Name: The Radical Line
Description: 海外技術メディア用。技術分野と国地域の検索。
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
Author: Functioneer
License: GPL-2.0-or-later
Text Domain: radical-line
*/


/* =========================================================
   Variables
   ========================================================= */

:root {
    --ink: #18212d;
    --muted: #68717b;
    --red: #ec503f;
    --line: #dde0e4;
    --soft: #f5f6f8;
}


/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        "Hiragino Kaku Gothic ProN",
        "Meiryo",
        sans-serif;
    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: #c83d2d;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 4px;
}


/* =========================================================
   Layout
   ========================================================= */

.wrap {
    max-width: 1200px;
    margin: auto;
    padding: 0 54px;
}


/* =========================================================
   Header
   ========================================================= */

.site-header {
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand strong {
    display: block;
    font-size: 19px;
    line-height: 1.4;
}

.brand small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 2px;
}

.mark {
    padding: 0 6px 6px 0;
    border-bottom: 4px solid var(--red);
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -6px;
}

.mark span,
.image-placeholder span {
    color: var(--red);
}


/* =========================================================
   Navigation
   ========================================================= */

nav ul,
.site-footer ul {
    display: flex;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    display: block;
    padding: 35px 0;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 700;
}

.nav-link,
nav .current-menu-item > a {
    border-bottom-color: var(--red);
}


/* =========================================================
   Hero
   ========================================================= */

.hero {
    display: grid;
    grid-template-columns: 1fr 266px;
    gap: 50px;
    align-items: end;
    padding: 70px 0 54px;
    border-bottom: 2px solid var(--ink);
}

.eyebrow {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.hero h1 {
    margin: 25px 0 26px;
    font-size: clamp(36px, 4.3vw, 56px);
    line-height: 1.4;
    letter-spacing: -2px;
}

.hero h1 span {
    color: var(--red);
}

.hero-desc {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.hero-aside {
    margin-bottom: 7px;
    padding: 5px 0 0 28px;
    border-left: 4px solid var(--red);
}

.hero-aside .eyebrow {
    margin: 0 0 16px;
    color: var(--ink);
    font-size: 11px;
}

.agency {
    margin: 0 0 18px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
}

.agency-sub {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   Explore
   ========================================================= */

.explore {
    padding: 46px 0 72px;
    scroll-margin-top: 30px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 36px;
}

.section-heading .eyebrow {
    margin-bottom: 9px;
}

.section-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.5;
}

.count {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}


/* =========================================================
   Filters
   ========================================================= */

.filters {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 174px 174px 70px;
    gap: 12px;
    margin-bottom: 30px;
}

.filters input,
.filters select,
.filters button {
    min-height: 48px;
    border-radius: 4px;
}

.search-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.search-label > span:not(.sr-only) {
    color: var(--muted);
    font-size: 26px;
}

.filters input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline-offset: 0;
}

.filters input::placeholder {
    color: #80868b;
    font-size: 14px;
}

.filters select {
    width: 100%;
    padding: 0 9px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--ink);
    font-size: 13px;
}

.filters button {
    color: #fff;
    background: var(--ink);
    border: 1px solid var(--ink);
    cursor: pointer;
    font-size: 13px;
}

.filters button:hover {
    background: #364355;
}


/* =========================================================
   Article Grid
   ========================================================= */

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

.card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 5px 25px #18212d0a;
}


/* =========================================================
   Article Card Image
   ========================================================= */

.card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--soft);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.card:hover img {
    transform: scale(1.025);
}

.image-placeholder {
    opacity: 0.45;
    font-size: 60px;
    font-weight: 800;
    letter-spacing: -6px;
}


/* =========================================================
   Article Card Content
   ========================================================= */

.card-body {
    padding: 20px;
}


/*
 * Categories / Technology Fields
 *
 * Each category receives --category-color from index.php.
 */

.card-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.card-categories .category {
    display: inline-block;
    padding: 3px 8px;

    color: var(--category-color, #bb382b);
    background: color-mix(
        in srgb,
        var(--category-color, #ec503f) 10%,
        white
    );

    border-radius: 2px;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;

    text-decoration: none;
}

.card-categories .category:hover {
    color: var(--category-color, #bb382b);

    background: color-mix(
        in srgb,
        var(--category-color, #ec503f) 18%,
        white
    );
}


/* Publication date */

.card-date {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 11px;
}

.card-date time {
    font-size: inherit;
}


/* Article title */

.card h2 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}


/* Article excerpt */

.excerpt {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.85;
}


/* Tags / Countries */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags a {
    padding: 3px 8px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 2px;
    font-size: 11px;
}


/* =========================================================
   Empty State
   ========================================================= */

.empty {
    padding: 60px 24px;
    background: var(--soft);
    border-top: 1px solid var(--line);
    text-align: center;
}

.empty .eyebrow {
    margin: 0 0 16px;
}

.empty h2,
.empty h1 {
    margin: 0 0 12px;
    font-size: 24px;
}

.empty p:not(.eyebrow) {
    color: var(--muted);
    font-size: 14px;
}


/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    padding: 38px 0;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 25px;
}

.site-footer strong {
    font-size: 14px;
    letter-spacing: 1px;
}

.site-footer p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.site-footer ul {
    font-size: 12px;
}


/* =========================================================
   Single Article
   ========================================================= */

.article-shell {
    max-width: 940px;
    padding-top: 50px;
    padding-bottom: 70px;
}

.back-link {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--muted);
    font-size: 13px;
}

.article-header {
    padding-bottom: 32px;
}

.article-header h1 {
    margin: 20px 0;
    font-size: clamp(27px, 3.3vw, 42px);
    line-height: 1.5;
    letter-spacing: -0.8px;
    overflow-wrap: anywhere;
}

.article-lead {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.9;
}

.featured {
    margin: 0 0 40px;
}

.featured img {
    display: block;
    width: 100%;
    height: auto;
}


/* =========================================================
   Article Body
   ========================================================= */

.entry-content {
    font-size: 16px;
    line-height: 2;
    overflow-wrap: anywhere;
}

.entry-content h2 {
    margin: 45px 0 20px;
    padding-left: 16px;
    border-left: 4px solid var(--red);
    font-size: 26px;
    line-height: 1.6;
}

.entry-content h3 {
    margin: 30px 0 16px;
    font-size: 21px;
}

.entry-content p {
    margin: 0 0 24px;
}

.entry-content a {
    color: #c13a2c;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content img,
.entry-content video,
.entry-content iframe {
    max-width: 100%;
}

.entry-content img {
    height: auto;
}

.entry-content figure {
    max-width: 100%;
}

.entry-content blockquote {
    margin: 30px 0;
    padding: 15px 24px;
    background: var(--soft);
    border-left: 3px solid var(--red);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
}

.entry-content td,
.entry-content th {
    padding: 10px;
    border: 1px solid var(--line);
}

.entry-content pre {
    padding: 20px;
    overflow: auto;
    background: var(--soft);
}

.alignwide,
.alignfull {
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
}

.article-end {
    margin-top: 45px;
    padding-top: 25px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}


/* =========================================================
   Pagination
   ========================================================= */

.pagination {
    margin-top: 40px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-numbers {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--line);
}

.page-numbers.current {
    color: #fff;
    background: var(--ink);
}


/* =========================================================
   Accessibility
   ========================================================= */

.sr-only,
.skip {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip:focus {
    top: 10px;
    left: 10px;
    z-index: 100000;

    width: auto;
    height: auto;
    margin: 0;
    padding: 12px 20px;

    clip: auto;
    background: #fff;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1000px) {

    .wrap {
        padding: 0 32px;
    }

    .article-shell {
        padding-top: 40px;
        padding-bottom: 60px;
    }

    .hero {
        grid-template-columns: 1fr 240px;
        gap: 25px;
    }

    .agency {
        font-size: 23px;
    }

    .filters {
        grid-template-columns: 1fr 1fr 70px;
    }

    .search-label {
        grid-column: 1 / -1;
    }

    .article-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 640px) {

    .wrap {
        padding: 0 22px;
    }

    .header-inner {
        min-height: 82px;
        gap: 15px;
    }

    .brand {
        gap: 10px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand small {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .mark {
        font-size: 32px;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 12px;
    }

    nav a {
        padding: 25px 0;
        font-size: 12px;
    }

    .hero {
        display: block;
        padding: 44px 0 34px;
    }

    .hero h1 {
        margin: 16px 0 20px;
        font-size: 38px;
        letter-spacing: -1.5px;
    }

    .hero-desc {
        font-size: 13px;
    }

    .hero-aside {
        margin-top: 30px;
        padding-left: 18px;
    }

    .hero-aside .eyebrow {
        margin-bottom: 9px;
    }

    .agency {
        margin-bottom: 8px;
        font-size: 21px;
    }

    .agency br {
        display: none;
    }

    .agency-sub {
        margin-top: 8px;
    }

    .explore {
        padding: 32px 0 48px;
    }

    .section-heading {
        margin-bottom: 24px;
    }

    .section-title {
        font-size: 24px;
    }

    .count {
        font-size: 10px;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .filters button {
        grid-column: 1 / -1;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .card-body {
        padding: 20px;
    }

    .footer-inner {
        display: block;
    }

    .site-footer ul {
        flex-wrap: wrap;
        gap: 16px;
        margin-top: 20px;
    }

    .article-shell {
        padding-top: 30px;
        padding-bottom: 50px;
    }

    .article-header h1 {
        font-size: 28px;
    }

    .article-lead {
        font-size: 15px;
    }

    .entry-content {
        font-size: 15px;
    }

    .entry-content h2 {
        font-size: 23px;
    }

    .empty {
        padding: 40px 18px;
    }

    .empty h2,
    .empty h1 {
        font-size: 21px;
    }
}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}