/*
Theme Name: PedalLog V5
Theme URI: https://pedallog.kr
Author: PedalLog
Description: 자전거와 서울 정보를 위한 간결하고 자연스러운 이미지 중심 워드프레스 테마입니다.
Version: 5.1.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
Text Domain: pedallog
Tags: blog, news, custom-logo, custom-menu, featured-images, translation-ready, wide-blocks
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
    --navy-950: #08182c;
    --navy-900: #10243e;
    --navy-800: #1b3d64;
    --orange: #ff642b;
    --orange-dark: #e84e15;
    --orange-soft: #fff1eb;
    --text: #1c2738;
    --muted: #6e7888;
    --line: #e6e9ee;
    --soft: #f6f7f9;
    --white: #ffffff;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;
    --shadow-soft: 0 8px 28px rgba(8, 24, 44, .055);
    --shadow: 0 18px 48px rgba(8, 24, 44, .09);
    --container: 1180px;
    --article: 760px;
    --header-height: 72px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--white);
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR",
        "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.78;
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

a:hover,
a:focus-visible {
    color: var(--orange-dark);
}

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

img {
    display: block;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
input[type="submit"] {
    cursor: pointer;
}

::selection {
    color: #fff;
    background: var(--orange);
}

.container {
    width: min(calc(100% - 40px), var(--container));
    margin-inline: auto;
}

.article-width {
    width: min(calc(100% - 40px), var(--article));
    margin-inline: auto;
}

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

.screen-reader-text:focus {
    z-index: 100000;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    padding: 12px 16px;
    clip: auto;
    color: #111;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Header */
.site-header {
    position: sticky;
    z-index: 1000;
    top: 0;
    min-height: var(--header-height);
    border-bottom: 1px solid rgba(8, 24, 44, .08);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
}

.header-inner {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.site-branding {
    flex: 0 0 auto;
}

.custom-logo-link {
    display: inline-flex;
    align-items: center;
}

.custom-logo {
    width: auto;
    max-width: 205px;
    max-height: 46px;
}

.site-title {
    margin: 0;
    color: var(--navy-900);
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.06em;
}

.brand-dot {
    color: var(--orange);
}

.primary-navigation {
    margin-left: auto;
}

.primary-navigation ul {
    display: flex;
    align-items: center;
    gap: 3px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-navigation a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 0 12px;
    color: #2b384c;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 760;
    transition: color .18s ease, background .18s ease;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a {
    color: var(--orange-dark);
    background: var(--orange-soft);
}

.menu-toggle {
    display: none;
    width: 45px;
    height: 45px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.menu-toggle span:not(.screen-reader-text) {
    display: block;
    width: 21px;
    height: 2px;
    margin: 5px auto;
    border-radius: 3px;
    background: var(--navy-900);
    transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Ads */
.ad-zone {
    text-align: center;
}

.header-ad {
    padding: 10px 0;
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-ad {
    padding: 22px 0;
    border-top: 1px solid var(--line);
    background: #fff;
}

.home-ad,
.article-ad {
    margin: 34px 0;
    padding: 16px 6px;
    border: 1px dashed #d8dde5;
    border-radius: 14px;
    background: #fafbfc;
    text-align: center;
}

.home-ad:empty,
.article-ad:empty {
    display: none;
}

.ad-widget {
    margin: 0;
}

.ad-rail {
    display: none;
}

@media (min-width: 1740px) {
    .ad-rail {
        position: fixed;
        z-index: 60;
        top: 124px;
        display: block;
        width: 160px;
        max-height: calc(100vh - 148px);
        overflow: hidden;
        text-align: center;
    }

    .ad-rail-left {
        left: 20px;
    }

    .ad-rail-right {
        right: 20px;
    }

    body.admin-bar .ad-rail {
        top: 156px;
    }
}

/* Home intro */
.home-intro {
    padding: 68px 0 30px;
}

.home-intro-inner {
    max-width: 1120px;
}

.home-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: var(--orange-dark);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.home-kicker::before {
    content: "";
    width: 28px;
    height: 3px;
    border-radius: 99px;
    background: var(--orange);
}

.home-intro h1 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(2.15rem, 3.5vw, 3.25rem);
    line-height: 1.14;
    font-weight: 950;
    letter-spacing: -.065em;
    white-space: nowrap;
}

.home-intro p {
    max-width: 700px;
    margin: 19px 0 0;
    color: var(--muted);
    font-size: 1rem;
}

/* Featured article */
.featured-section {
    padding: 18px 0 34px;
}

.featured-card {
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(350px, .72fr);
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
}

.featured-image {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #f1f3f6;
}

.featured-image a {
    display: block;
    width: 100%;
}

.featured-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.featured-placeholder {
    display: grid;
    min-height: 430px;
    place-items: center;
    background:
        radial-gradient(circle at 82% 17%, rgba(255, 100, 43, .23), transparent 27%),
        linear-gradient(135deg, #183e69, #0a1c32);
}

.featured-placeholder img {
    width: min(34%, 220px);
    height: auto;
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(34px, 4vw, 52px);
}

.category-pill {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    color: var(--orange-dark);
    border-radius: 999px;
    background: var(--orange-soft);
    font-size: .71rem;
    line-height: 1.2;
    font-weight: 900;
}

.featured-content h2 {
    margin: 15px 0 13px;
    color: var(--navy-900);
    font-size: clamp(1.65rem, 2.8vw, 2.45rem);
    line-height: 1.3;
    letter-spacing: -.045em;
}

.featured-content p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.68;
}

.featured-meta,
.post-meta,
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 12px;
    color: var(--muted);
    font-size: .75rem;
}

.featured-meta {
    margin-top: 20px;
}

.featured-more {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 7px;
    margin-top: 25px;
    color: var(--navy-900);
    font-size: .86rem;
    font-weight: 900;
}

.featured-more::after {
    content: "→";
    color: var(--orange);
    font-size: 1rem;
}

/* Category navigation */
.category-section {
    padding: 0 0 60px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.category-card {
    display: flex;
    min-height: 78px;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: #ffc8b2;
    box-shadow: var(--shadow);
}

.category-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--orange-dark);
    border-radius: 12px;
    background: var(--orange-soft);
}

.category-icon svg {
    width: 23px;
    height: 23px;
    stroke: currentColor;
}

.category-card strong {
    display: block;
    color: var(--navy-900);
    font-size: .92rem;
    line-height: 1.3;
}

.category-card small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .74rem;
    line-height: 1.35;
}

/* Sections */
.home-section {
    padding: 68px 0 78px;
    border-top: 1px solid var(--line);
    background: var(--soft);
}

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

.section-heading h2 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.2;
    letter-spacing: -.055em;
}

.section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.section-link {
    flex: 0 0 auto;
    color: var(--orange-dark);
    font-size: .84rem;
    font-weight: 900;
}

/* Post cards */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 21px;
}

.post-grid.count-1 {
    grid-template-columns: minmax(0, 760px);
}

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

.post-card {
    overflow: hidden;
    display: flex;
    min-width: 0;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: #ffc8b2;
    box-shadow: var(--shadow);
}

.post-thumbnail {
    display: grid;
    aspect-ratio: 16 / 10;
    place-items: center;
    overflow: hidden;
    background: #f0f2f5;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .35s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.018);
}

.post-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background:
        radial-gradient(circle at 82% 17%, rgba(255, 100, 43, .2), transparent 25%),
        linear-gradient(135deg, #183e69, #0a1b31);
}

.post-placeholder img {
    width: 30%;
    max-width: 105px;
    height: auto;
}

.post-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px;
}

.post-body h3 {
    margin: 10px 0 9px;
    color: var(--navy-900);
    font-size: 1.08rem;
    line-height: 1.47;
    letter-spacing: -.025em;
}

.post-body p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.63;
}

/* Archives */
.content-area {
    min-height: 64vh;
    padding: 62px 0 86px;
}

.archive-header,
.search-header {
    max-width: 760px;
    margin-bottom: 31px;
}

.archive-header h1,
.search-header h1 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.15;
    letter-spacing: -.065em;
}

.archive-description {
    margin-top: 11px;
    color: var(--muted);
}

.pagination {
    margin-top: 39px;
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.page-numbers {
    display: grid;
    min-width: 42px;
    height: 42px;
    place-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: .84rem;
    font-weight: 850;
}

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

/* Single article */
.article-page {
    padding: 58px 0 90px;
}

.article-header {
    width: min(calc(100% - 40px), 920px);
    margin: 0 auto 30px;
    text-align: center;
}

.article-header .category-pill {
    margin-bottom: 14px;
}

.entry-title {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(2rem, 4.2vw, 3.35rem);
    line-height: 1.22;
    letter-spacing: -.06em;
}

.article-header .entry-meta {
    justify-content: center;
    margin-top: 16px;
}

.article-cover {
    overflow: hidden;
    width: min(calc(100% - 40px), 1060px);
    margin: 0 auto 50px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f0f2f5;
    box-shadow: var(--shadow-soft);
}

.article-cover img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.article-cover-placeholder {
    display: grid;
    min-height: 420px;
    place-items: center;
    background:
        radial-gradient(circle at 82% 17%, rgba(255, 100, 43, .2), transparent 26%),
        linear-gradient(135deg, #183e69, #0a1b31);
}

.article-cover-placeholder img {
    width: min(28%, 210px);
    height: auto;
}

.entry-content {
    color: #303b4c;
    font-size: 1.035rem;
    line-height: 1.9;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-content p {
    margin: 0 0 1.48em;
}

.entry-content h2 {
    margin: 2.35em 0 .78em;
    padding-bottom: .48em;
    color: var(--navy-900);
    border-bottom: 2px solid #edf0f4;
    font-size: clamp(1.55rem, 3vw, 2.05rem);
    line-height: 1.4;
    letter-spacing: -.04em;
}

.entry-content h3 {
    margin: 1.85em 0 .62em;
    color: var(--navy-800);
    font-size: 1.3rem;
    line-height: 1.45;
    letter-spacing: -.025em;
}

.entry-content h4 {
    margin: 1.55em 0 .5em;
    color: var(--navy-800);
    font-size: 1.1rem;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.55em;
    padding-left: 1.35em;
}

.entry-content li {
    margin-bottom: .48em;
}

.entry-content blockquote {
    margin: 1.85em 0;
    padding: 22px 24px;
    color: #384458;
    border-left: 5px solid var(--orange);
    border-radius: 0 14px 14px 0;
    background: #fff6f1;
}

.entry-content figure {
    margin: 2em 0;
}

.entry-content figure img,
.entry-content > img {
    border-radius: 15px;
}

.entry-content figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: .79rem;
    text-align: center;
}

.entry-content table {
    display: table;
    width: 100%;
    margin: 1.8em 0;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: .9rem;
}

.entry-content th,
.entry-content td {
    padding: 12px 13px;
    border: 1px solid var(--line);
    text-align: left;
}

.entry-content th {
    color: var(--navy-900);
    background: #f3f5f8;
}

.entry-content pre {
    overflow: auto;
    margin: 1.85em 0;
    padding: 21px;
    color: #e8eef7;
    border-radius: 14px;
    background: #0d1c31;
    font-family: Consolas, Monaco, monospace;
    font-size: .87rem;
    line-height: 1.7;
}

.entry-content code {
    padding: .12em .33em;
    border-radius: 5px;
    background: #eef2f6;
    font-family: Consolas, Monaco, monospace;
    font-size: .9em;
}

.entry-content pre code {
    padding: 0;
    background: transparent;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 38px;
    padding-top: 23px;
    border-top: 1px solid var(--line);
}

.entry-tags a {
    padding: 6px 10px;
    color: var(--muted);
    border-radius: 999px;
    background: #f0f3f7;
    font-size: .77rem;
}

/* Pages */
.page-shell {
    width: min(calc(100% - 40px), 860px);
    margin-inline: auto;
}

.page-header {
    padding: 62px 0 31px;
}

.page-title {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.15;
    letter-spacing: -.06em;
}

.page-content {
    padding: 0 0 84px;
}

/* Empty states */
.not-found {
    padding: 65px 28px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.error-code {
    display: block;
    color: var(--orange);
    font-size: clamp(5rem, 12vw, 8.5rem);
    line-height: 1;
    font-weight: 950;
}

/* Minimal footer */
.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-inner {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: #8993a2;
    font-size: .78rem;
}

.footer-brand {
    color: var(--navy-900);
    font-weight: 900;
}

.footer-menu ul {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    color: #788395;
}

.no-posts-admin {
    padding: 39px;
    text-align: center;
    border: 2px dashed #d6dce5;
    border-radius: var(--radius);
    background: #fff;
}

.alignwide {
    width: min(1080px, calc(100vw - 40px));
    max-width: none;
    margin-right: 50%;
    margin-left: 50%;
    transform: translateX(-50%);
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

@media (max-width: 1000px) {
    .home-intro h1 {
        white-space: normal;
    }

    .primary-navigation a {
        padding-inline: 9px;
        font-size: .84rem;
    }

    .featured-card {
        grid-template-columns: 1fr;
    }

    .featured-image {
        border-bottom: 1px solid var(--line);
    }

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

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

    .post-grid.count-1 {
        grid-template-columns: minmax(0, 760px);
    }
}

@media (max-width: 840px) {
    body.admin-bar .site-header {
        top: 46px;
    }

    .menu-toggle {
        display: block;
    }

    .primary-navigation {
        position: absolute;
        top: calc(100% + 1px);
        right: 0;
        left: 0;
        display: none;
        max-height: calc(100vh - 95px);
        overflow: auto;
        padding: 15px 20px 22px;
        border-bottom: 1px solid var(--line);
        background: #fff;
        box-shadow: 0 22px 40px rgba(8, 24, 44, .12);
    }

    .primary-navigation.is-open {
        display: block;
    }

    .primary-navigation ul {
        display: grid;
        gap: 3px;
    }

    .primary-navigation a {
        display: block;
        padding: 12px 11px;
        font-size: .91rem;
    }
}

@media (max-width: 650px) {
    body {
        font-size: 16px;
    }

    .container,
    .article-width,
    .page-shell,
    .article-header,
    .article-cover {
        width: min(calc(100% - 28px), var(--container));
    }

    .header-inner {
        min-height: 66px;
    }

    .custom-logo {
        max-width: 178px;
        max-height: 41px;
    }

    .site-title {
        font-size: 1.42rem;
    }

    .home-intro {
        padding: 43px 0 22px;
    }

    .home-intro h1 {
        font-size: 2.25rem;
    }

    .featured-section {
        padding-top: 10px;
    }

    .featured-card {
        border-radius: 18px;
    }

    .featured-content {
        padding: 27px 22px 31px;
    }

    .featured-content h2 {
        font-size: 1.75rem;
    }

    .category-section {
        padding-bottom: 44px;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .category-card {
        min-height: 69px;
    }

    .home-section {
        padding: 52px 0 60px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 23px;
    }

    .section-heading h2 {
        font-size: 1.8rem;
    }

    .post-grid,
    .post-grid.count-1,
    .post-grid.count-2 {
        grid-template-columns: 1fr;
    }

    .post-body {
        padding: 18px;
    }

    .article-page {
        padding: 38px 0 68px;
    }

    .entry-title {
        font-size: 2rem;
    }

    .article-cover {
        margin-bottom: 38px;
        border-radius: 14px;
    }

    .article-cover-placeholder {
        min-height: 290px;
    }

    .entry-content {
        font-size: 1rem;
        line-height: 1.84;
    }

    .entry-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .article-ad {
        margin: 28px -4px;
        padding-inline: 4px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 20px 0;
    }
}
