/*
Theme Name: PressCarry
Theme URI: 
Author: Antigravity
Author URI: 
Description: A custom news theme with a header (logo, search, categories) and a right sidebar.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: presscarry
*/

/* Reset and Basic Typography */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    color: #333;
    background-color: #e5e5e5;
    line-height: 1.5;
}

a {
    color: #0044cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout Structure */
.site-container {
    width: 100%;
    /* 画面高さを基準に16:9の比率を最大幅とし、画面の幅に合わせる */
    max-width: calc(100vh * 16 / 9);
    min-height: 100vh;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Header Top */
.site-header {
    background-color: #fff;
}

.header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 2px solid #ff0033; /* ニュースサイトらしい赤のライン */
}

.site-branding {
    flex: 1;
    min-width: 250px;
}

.site-title {
    margin: 0;
    font-size: 2em;
    font-weight: 900;
}

.site-title a {
    color: #222;
    text-decoration: none;
}

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

.header-utilities {
    display: flex;
    align-items: center;
    gap: 20px;
}

.utility-links {
    display: flex;
    gap: 15px;
}

.utility-links a {
    color: #333;
    font-size: 0.85em;
    font-weight: bold;
}

.utility-search form {
    display: flex;
}

.utility-search input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 2px 0 0 2px;
    width: 200px;
}

.utility-search input[type="text"]:focus {
    border-color: #ff0033;
    outline: none;
}

.utility-search input[type="submit"] {
    padding: 6px 15px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-left: none;
    cursor: pointer;
    border-radius: 0 2px 2px 0;
}

.utility-buttons {
    display: flex;
    gap: 10px;
}

.utility-buttons a {
    padding: 6px 15px;
    border: 1px solid #ff0033;
    border-radius: 2px;
    font-weight: bold;
    font-size: 0.9em;
    text-decoration: none;
}

.btn-subscribe {
    background-color: #fff;
    color: #ff0033;
}

.btn-login {
    background-color: #ff0033;
    color: #fff;
}

/* Primary Navigation (Categories) */
.main-navigation {
    width: 100%;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.main-navigation li {
    border-right: 1px solid #ddd;
    flex: 1;
    text-align: center;
}

.main-navigation li:first-child {
    border-left: 1px solid #ddd;
}

.main-navigation li a {
    display: block;
    padding: 12px 25px;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.main-navigation li a:hover {
    background-color: #fff;
    color: #ff0033;
    text-decoration: none;
}

/* Main Content Area */
.site-content {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    flex: 1 0 auto;
    max-width: 1200px;
    margin: 0 auto;
}

.primary-content {
    flex: 1;
    min-width: 60%;
    padding-right: 30px;
}

.primary-content.asahi-style-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.home-main-col {
    flex: 1.5;
    min-width: 300px;
}

.home-sub-col {
    flex: 1;
    min-width: 250px;
}

.secondary-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* News List Style */
.section-title {
    font-size: 1.2em;
    font-weight: bold;
    border-left: 5px solid #ff0033;
    padding-left: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}

/* 共通アイキャッチ設定 (16:9比率で、余白は黒) */
.post-thumbnail {
    background-color: #000;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 画像を切り抜かずに全体を表示し、余白を埋める */
}

/* Featured Top Article */
.post-featured {
    margin-bottom: 30px;
}

.post-featured .post-thumbnail {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 15px;
}

.post-featured .post-title {
    font-size: 1.6em;
    margin: 5px 0;
    line-height: 1.4;
}

.post-featured .post-title a {
    color: #111;
}

.post-featured .post-title a:hover {
    color: #ff0033;
}

.post-featured .entry-summary {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 10px;
}

/* News List Items */
.post-list-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.home-sub-col .post-list-wrapper, .widget .post-list-wrapper {
    display: block;
}

.post-list-item {
    display: flex;
    align-items: flex-start;
}

/* カード型レイアウト（メインカラムの記事） */
.post-list-item:not(.side-thumbnail) {
    flex-direction: column;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.post-list-item:not(.side-thumbnail) .post-thumbnail {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
    border-radius: 0;
}

.post-list-item:not(.side-thumbnail) .post-content-wrap {
    padding: 10px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* リスト型レイアウト（サブカラムの記事） */
.post-list-item.side-thumbnail {
    flex-direction: row-reverse;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.post-list-item.side-thumbnail .post-thumbnail {
    margin-right: 0;
    margin-left: 15px;
    width: 80px;
    flex-shrink: 0;
}

.post-list-item .post-content-wrap {
    flex: 1;
}

.post-list-item .post-title {
    font-size: 1.05em;
    margin: 0 0 5px 0;
    line-height: 1.4;
    font-weight: bold;
}

.post-list-item.side-thumbnail .post-title {
    font-size: 0.95em;
}

.post-list-item .post-title a {
    color: #222;
}

.post-list-item .post-title a:hover {
    color: #ff0033;
}

/* Meta Data (Date & Category) */
.post-meta {
    font-size: 0.8em;
    color: #888;
    display: flex;
    align-items: center;
}

.cat-badge {
    background-color: #f2f2f2;
    color: #555;
    padding: 2px 6px;
    border-radius: 2px;
    margin-right: 10px;
    font-weight: bold;
    font-size: 0.8em;
}

.cat-badge.outline {
    background-color: transparent;
    border: 1px solid #ccc;
    color: #777;
}

/* Sidebar Widgets */
.widget {
    margin-bottom: 30px;
    background: #fff;
    border: none;
    padding: 0;
}

.widget-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1em;
    font-weight: bold;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 10px 15px;
    background: #fff;
    display: inline-block;
    border-top: 3px solid #ff0033; /* Tab-like top border */
}

.widget ul {
    border: 1px solid #ddd;
    padding: 15px;
}
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px dotted #ccc;
    font-size: 0.95em;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #333;
}

.widget ul li a:hover {
    color: #ff0033;
}

.no-posts-message {
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
    color: #666;
    text-align: center;
    margin-bottom: 30px;
}

/* Ads */
.presscarry-ad {
    margin-top: 15px;
    text-align: right;
    width: 100%;
}

.ad-location-sidebar {
    text-align: center;
    margin-bottom: 20px;
}

/* Single Post Page */
.single-article {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.single-entry-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.single-post-meta {
    margin-bottom: 10px;
}

.single-post-title {
    font-size: 2em;
    margin: 0;
    line-height: 1.4;
    color: #111;
}

.single-post-thumbnail {
    margin-bottom: 30px;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.entry-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
}

.entry-content::after {
    content: "";
    display: table;
    clear: both;
}

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

.entry-content img {
    max-width: 100%;
    width: 25%; /* 指定通り約25%サイズに統一 */
    height: auto;
    float: left;
    margin: 0 20px 20px 0;
    border-radius: 4px;
}

/* もしWordPress標準の画像ブロック（figure）が使われた場合の余白調整 */
.entry-content figure.wp-block-image {
    float: left;
    margin: 0 20px 20px 0;
    width: 25%;
}
.entry-content figure.wp-block-image img {
    width: 100%;
    margin: 0;
}

.entry-content h2 {
    font-size: 1.5em;
    border-left: 5px solid #ff0033;
    padding-left: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    margin-bottom: 40px;
}

.nav-subtitle {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 5px;
}

.nav-title {
    font-weight: bold;
    color: #0044cc;
}

/* Author Bio */
.author-bio {
    display: flex;
    align-items: flex-start;
    background: #f9f9f9;
    padding: 25px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 40px;
}

.author-avatar {
    flex-shrink: 0;
    margin-right: 20px;
}

.author-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.author-info {
    flex: 1;
}

.author-name {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #222;
}

.author-description p {
    margin: 0;
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    background-color: #f0f0f0;
    padding: 30px 0 20px 0;
    text-align: center;
    border-top: 1px solid #ddd;
}

.footer-navigation {
    margin-bottom: 20px;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-menu li {
    flex: 1;
    text-align: center;
    border-right: 1px solid #ccc;
}

.footer-menu li:last-child {
    border-right: none;
}

.footer-menu li a {
    color: #555;
    text-decoration: none;
    font-size: 0.9em;
}

.footer-menu li a:hover {
    color: #ff0033;
    text-decoration: underline;
}

.site-info {
    color: #777;
    font-size: 0.85em;
}

.site-footer a {
    color: #333;
    font-weight: bold;
}

/* Header and Footer Widgets */
.header-widget-area {
    background-color: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

.footer-widget-area {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
}

.footer-widget-area .widget-title {
    color: #fff;
    border-top-color: #666;
}

.footer-widget-area a {
    color: #ddd;
}

.footer-widget-area a:hover {
    color: #fff;
}

.header-widget-area .site-container,
.footer-widget-area .site-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.header-widget-area .widget,
.footer-widget-area .widget {
    flex: 1;
    min-width: 250px;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .site-content {
        flex-direction: column;
    }
    
    .primary-content {
        padding-right: 0;
    }
    
    .secondary-sidebar {
        width: 100%;
        margin-top: 30px;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .header-search {
        margin-top: 15px;
        justify-content: center;
    }
    
    .main-navigation ul {
        justify-content: center;
    }
}

/* =========================================
   XWRITE風 記事装飾＆目次機能スタイル
========================================= */

/* (Existing XWRITE styles...) */

/* =========================================
   ブロックパターン（会社概要など）
========================================= */
.pc-company-profile {
    margin: 40px 0;
}

.pc-company-profile table {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid var(--pc-main-color, #ff0033);
    border-bottom: 2px solid var(--pc-main-color, #ff0033);
}

.pc-company-profile td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    line-height: 1.6;
}

.pc-company-profile td:first-child {
    width: 30%;
    background-color: #f9f9f9;
    font-weight: bold;
}

/* テーブルの外枠なしスタイル */
.wp-block-table.is-style-pc-table-no-border table,
.wp-block-table.is-style-pc-table-no-border th,
.wp-block-table.is-style-pc-table-no-border td {
    border: none;
}
.wp-block-table.is-style-pc-table-no-border td,
.wp-block-table.is-style-pc-table-no-border th {
    border-bottom: 1px solid #eee;
}
.wp-block-table.is-style-pc-table-no-border tr:last-child td,
.wp-block-table.is-style-pc-table-no-border tr:last-child th {
    border-bottom: none;
}

/* マーカー線（蛍光ペン） */
.pc-marker {
    background: linear-gradient(transparent 60%, var(--pc-marker-color, #ffeb3b) 60%);
    font-weight: bold;
}
.pc-marker-yellow { --pc-marker-color: #ffeb3b; }
.pc-marker-pink { --pc-marker-color: #ffc0cb; }
.pc-marker-blue { --pc-marker-color: #add8e6; }

/* ボックス枠 */
.pc-box {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    background-color: #f9f9f9;
    border: 2px solid #ddd;
}
.pc-box-info {
    border-color: #2196F3;
    background-color: #e3f2fd;
}
.pc-box-warning {
    border-color: #ff9800;
    background-color: #fff3e0;
}
.pc-box-danger {
    border-color: #f44336;
    background-color: #ffebee;
}

/* ボタン */
.pc-btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--pc-main-color, #ff0033);
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    transition: opacity 0.2s;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.pc-btn:hover {
    opacity: 0.8;
}

/* 自動目次 (Table of Contents) */
.pc-toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 20px;
    margin: 30px 0;
    display: table;
    min-width: 50%;
}
.pc-toc-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid var(--pc-main-color, #ff0033);
    padding-bottom: 10px;
    display: inline-block;
}
.pc-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pc-toc li {
    margin-bottom: 8px;
    line-height: 1.5;
}
.pc-toc-h2 {
    font-weight: bold;
}
.pc-toc-h3 {
    margin-left: 20px;
    font-size: 0.9em;
}
.pc-toc a {
    color: #333;
    text-decoration: none;
}
.pc-toc a:hover {
    color: var(--pc-main-color, #ff0033);
    text-decoration: underline;
}
