/*
Theme Name: PR Curation
Theme URI: https://pr.asogi.co.jp
Author: Asogi
Author URI: https://asogi.co.jp
Description: A clean, professional magazine-style theme for healthcare PR curation. Designed for Japanese healthcare news with AI-powered summaries and weekly roundups.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pr-curation
Tags: blog, news, healthcare, japanese, magazine, responsive
*/

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --color-primary: #1a5276;
    --color-primary-light: #2980b9;
    --color-primary-dark: #0e3a55;
    --color-accent: #2e86c1;
    --color-accent-light: #5dade2;
    --color-bg: #f8f9fa;
    --color-bg-white: #ffffff;
    --color-bg-subtle: #eef2f7;
    --color-text: #2c3e50;
    --color-text-light: #5d6d7e;
    --color-text-muted: #95a5a6;
    --color-border: #dce3ea;
    --color-border-light: #ecf0f1;
    --color-success: #27ae60;
    --color-category-badge: #e8f4fd;
    --color-category-text: #1a5276;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "MS PMincho", Georgia, "Times New Roman", serif;
    --max-width: 1200px;
    --content-width: 780px;
    --transition: 0.2s ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-wrap: break-word;
    word-break: break-word;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ============================================
   Layout
   ============================================ */
.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    flex: 1;
    padding: 48px 0;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.site-branding {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.site-title a {
    color: var(--color-primary);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--color-primary-dark);
}

.site-tagline {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 2px;
    letter-spacing: 0.01em;
}


/* Navigation */
.main-navigation {
    border-top: 1px solid var(--color-border-light);
}

.nav-menu {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-menu li a {
    display: block;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a,
.nav-menu li.current-cat a {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text);
}

/* ============================================
   Hero / Page Header
   ============================================ */
.page-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #fff;
    padding: 40px 0;
    margin-bottom: 0;
}

.page-header .container {
    max-width: var(--max-width);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.page-description {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Archive-specific header */
.archive-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #fff;
    padding: 36px 0;
}

.archive-header .page-title {
    font-size: 1.5rem;
}

.archive-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    margin-bottom: 4px;
}

/* ============================================
   Post Cards (Index / Archive)
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.post-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card-inner {
    display: flex;
    gap: 0;
}

.post-card-thumbnail {
    flex-shrink: 0;
    width: 280px;
    min-height: 200px;
    overflow: hidden;
}

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

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

.post-card-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, var(--color-bg-subtle) 0%, var(--color-border-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-thumbnail-placeholder svg {
    width: 48px;
    height: 48px;
    fill: var(--color-border);
}

.post-card-content {
    flex: 1;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.post-card-category {
    display: inline-block;
    background: var(--color-category-badge);
    color: var(--color-category-text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.post-card-category:hover {
    background: var(--color-primary);
    color: #fff;
}

.post-card-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.post-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

.post-card-title a {
    color: var(--color-text);
}

.post-card-title a:hover {
    color: var(--color-primary);
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.7;
    flex: 1;
}

.post-card-readmore {
    margin-top: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary-light);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-card-readmore:hover {
    color: var(--color-primary-dark);
    gap: 8px;
}

/* Featured / first post larger */
.post-card.post-featured {
    grid-column: 1 / -1;
}

.post-card.post-featured .post-card-inner {
    flex-direction: column;
}

.post-card.post-featured .post-card-thumbnail {
    width: 100%;
    max-height: 360px;
}

.post-card.post-featured .post-card-title {
    font-size: 1.5rem;
}

/* ============================================
   Single Post
   ============================================ */
.single-post-header {
    background: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border-light);
    padding: 40px 0 32px;
}

.single-post-header .container {
    max-width: var(--content-width);
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.single-post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: 16px;
}

.single-post-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.single-post-info .separator {
    width: 4px;
    height: 4px;
    background: var(--color-border);
    border-radius: 50%;
}

.single-post-thumbnail {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}

.single-post-thumbnail img {
    width: 100%;
    border-radius: var(--radius-md);
    margin-top: 32px;
}

/* Post content */
.single-post-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 40px 24px 64px;
}

.entry-content {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--color-text);
}

.entry-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary-dark);
    line-height: 1.5;
}

.entry-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 36px 0 16px;
    color: var(--color-text);
    line-height: 1.5;
    padding-left: 14px;
    border-left: 3px solid var(--color-accent);
}

.entry-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--color-text);
    line-height: 1.5;
}

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

.entry-content ul,
.entry-content ol {
    margin: 0 0 24px 24px;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.entry-content blockquote {
    margin: 28px 0;
    padding: 20px 24px;
    background: var(--color-bg-subtle);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content a {
    color: var(--color-primary-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(41, 128, 185, 0.3);
}

.entry-content a:hover {
    color: var(--color-primary-dark);
    text-decoration-color: var(--color-primary-dark);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.9rem;
}

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

.entry-content table th {
    background: var(--color-bg-subtle);
    font-weight: 600;
}

.entry-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 24px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.entry-content code {
    background: var(--color-bg-subtle);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

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

.entry-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 40px 0;
}

.entry-content img {
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

.entry-content .wp-caption {
    max-width: 100%;
    margin: 24px 0;
}

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

/* Post navigation */
.post-navigation {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.post-nav-item {
    background: var(--color-bg-white);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.post-nav-item:hover {
    box-shadow: var(--shadow-md);
}

.post-nav-item.nav-next {
    text-align: right;
}

.post-nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.post-nav-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.5;
}

.post-nav-item a:hover .post-nav-title {
    color: var(--color-primary);
}

/* Tags */
.post-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}

.post-tags-title {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

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

.post-tags-list a {
    display: inline-block;
    background: var(--color-bg-subtle);
    color: var(--color-text-light);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all var(--transition);
}

.post-tags-list a:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ============================================
   Page Template
   ============================================ */
.page-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 48px 24px 64px;
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.page-content .page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-primary);
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border-light);
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-light);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.pagination .page-numbers:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

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

.pagination .dots {
    border: none;
    background: none;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-copyright {
    font-size: 0.8rem;
}

.footer-back-top {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition);
}

.footer-back-top:hover {
    color: #fff;
}

/* ============================================
   Sidebar / Widgets (optional)
   ============================================ */
.widget {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================
   404 Page
   ============================================ */
.error-404-content {
    text-align: center;
    padding: 80px 24px;
}

.error-404-content h1 {
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.error-404-content p {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 32px;
}

.error-404-content .btn-home {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background var(--transition);
}

.error-404-content .btn-home:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

/* ============================================
   No Posts
   ============================================ */
.no-posts {
    text-align: center;
    padding: 64px 24px;
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
}

.no-posts h2 {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.no-posts p {
    color: var(--color-text-muted);
}

/* ============================================
   WordPress Core Alignment
   ============================================ */
.alignleft {
    float: left;
    margin-right: 24px;
    margin-bottom: 16px;
}

.alignright {
    float: right;
    margin-left: 24px;
    margin-bottom: 16px;
}

.aligncenter {
    display: block;
    margin: 24px auto;
}

.wp-block-image figcaption {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablets */
@media (max-width: 960px) {
    .post-card-inner {
        flex-direction: column;
    }

    .post-card-thumbnail {
        width: 100%;
        max-height: 220px;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .single-post-title {
        font-size: 1.6rem;
    }
}

/* Mobile */
@media (max-width: 680px) {
    :root {
        --max-width: 100%;
    }

    html {
        font-size: 15px;
    }

    .header-top {
        padding: 12px 0;
    }

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

    .site-tagline {
        font-size: 0.7rem;
    }

    .header-badge {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
    }

    .nav-menu.is-active {
        display: flex;
    }

    .nav-menu li a {
        padding: 12px 0;
        border-bottom-width: 0;
        border-left: 3px solid transparent;
        padding-left: 12px;
    }

    .nav-menu li a:hover,
    .nav-menu li.current-menu-item a {
        border-bottom-color: transparent;
        border-left-color: var(--color-primary);
    }

    .page-header {
        padding: 28px 0;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .main-content {
        padding: 24px 0;
    }

    .posts-grid {
        gap: 16px;
    }

    .post-card-content {
        padding: 16px 20px;
    }

    .post-card-title {
        font-size: 1.05rem;
    }

    .post-card.post-featured .post-card-title {
        font-size: 1.2rem;
    }

    .single-post-header {
        padding: 28px 0 24px;
    }

    .single-post-title {
        font-size: 1.4rem;
    }

    .single-post-content {
        padding: 28px 20px 48px;
    }

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

    .entry-content h2 {
        font-size: 1.3rem;
        margin-top: 36px;
    }

    .entry-content h3 {
        font-size: 1.15rem;
        margin-top: 28px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .post-navigation,
    .pagination {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .single-post-title {
        font-size: 18pt;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
