/*
Theme Name: ishinomakitv
Theme URI: https://ishinomaki.tv/
Author: mahoro
Description: いしのまきTV（石巻市・東松島市周辺の地域情報ポータル）用の独自テーマ。お店情報の短報を読みやすく並べる、軽量なクラシックテーマ。
Version: 0.2.0
Requires at least: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: ishinomakitv
*/

/* ==========================================================================
   デザイントークン
   ========================================================================== */
:root {
	--c-bg: #f5f8fa;
	--c-surface: #ffffff;
	--c-text: #1f2d3a;
	--c-muted: #5f6f7d;
	--c-line: #dde5ec;
	--c-brand: #0a6c9b;       /* 海の青 */
	--c-brand-dark: #07506f;
	--c-new: #1b8a5a;         /* 新店・移転・再開 */
	--c-close: #b5472f;       /* 閉店・休業 */
	--radius: 8px;
	--shadow: 0 1px 3px rgba(20, 40, 60, .08);
	--w-site: 1120px;
	--w-main: 740px;
	--font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

/* ==========================================================================
   ベース
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.8;
	word-break: break-word;
}
img { max-width: 100%; height: auto; vertical-align: bottom; }
a { color: var(--c-brand); text-underline-offset: 2px; }
a:hover { color: var(--c-brand-dark); }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 100; clip: auto; width: auto; height: auto;
	padding: 8px 14px; background: #fff; color: var(--c-brand);
}
.container { width: min(100% - 32px, var(--w-site)); margin-inline: auto; }

/* ==========================================================================
   ヘッダー
   ========================================================================== */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
/*
 * ヘッダーは「ロゴ｜メニュー」の2列グリッド。
 * 自動広告などがヘッダー内に差し込む要素は、列を奪わないよう全幅の別行に回す。
 */
.site-header__top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 24px; padding-block: 14px; }
.site-header__top > :not(.site-branding):not(.menu-toggle):not(.main-nav) {
	grid-column: 1 / -1; min-width: 0; max-width: 100%; margin-inline: auto; overflow: hidden; text-align: center;
}
.site-branding { min-width: 0; }
.site-branding > :not(.site-title):not(.site-description):not(.custom-logo-link) { max-width: 100%; margin-top: 6px; }
.site-title { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.site-title a { color: var(--c-brand); text-decoration: none; }
.site-description { margin: 0; font-size: .75rem; color: var(--c-muted); line-height: 1.4; }
.menu-toggle {
	display: none; border: 1px solid var(--c-line); background: #fff; color: var(--c-text);
	padding: 8px 14px; border-radius: var(--radius); font: inherit; font-size: .9rem; cursor: pointer;
}
.main-nav ul, .cat-nav ul, .footer-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav { min-width: 0; }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: flex-end; font-size: .9rem; }
.main-nav a { color: var(--c-text); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { border-bottom-color: var(--c-brand); }

.cat-nav { background: var(--c-brand); }
.cat-nav ul { display: flex; flex-wrap: wrap; }
.cat-nav a {
	display: block; padding: 10px 16px; color: #fff; text-decoration: none; font-size: .9rem; font-weight: 600;
}
.cat-nav a:hover, .cat-nav .current-cat > a, .cat-nav .current-menu-item > a { background: var(--c-brand-dark); color: #fff; }

/* ==========================================================================
   レイアウト
   ========================================================================== */
.site-content { padding-block: 28px 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.layout--single { grid-template-columns: minmax(0, var(--w-main)); justify-content: center; }
.breadcrumb { font-size: .8rem; color: var(--c-muted); margin: 0 0 16px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 6px; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--c-line); }
.breadcrumb a { color: var(--c-muted); }

.section-title {
	font-size: 1.15rem; margin: 0 0 14px; padding-left: 12px; border-left: 4px solid var(--c-brand);
}
.archive-header { margin-bottom: 20px; }
.archive-header .section-title { font-size: 1.4rem; }
.archive-header p { margin: 0; color: var(--c-muted); font-size: .9rem; }

/* ==========================================================================
   カテゴリ表示（複数付与）
   ========================================================================== */
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.cat-chip {
	display: inline-block; padding: 1px 10px; font-size: .72rem; line-height: 1.7; border-radius: 99px;
	background: #e6f0f6; color: var(--c-brand-dark); text-decoration: none; font-weight: 600;
}
.cat-chip:hover { background: #d3e5ef; color: var(--c-brand-dark); }
.cat-chip--newshop { background: #e1f3ea; color: var(--c-new); }
.cat-chip--closesshop { background: #f8e6e1; color: var(--c-close); }

/* ==========================================================================
   広告まわり（Google AdSense など）
   - 広告はテーマのレイアウトを押し広げないよう、はみ出しを抑える。
   - 意図した位置には、ウィジェット枠（ヘッダー下／記事下）に置く。
   ========================================================================== */
ins.adsbygoogle, .adsbygoogle { max-width: 100%; }
.main-content-area ins, .layout__main ins.adsbygoogle { display: block; overflow: hidden; }
.ad-slot { margin-block: 16px; text-align: center; overflow: hidden; max-width: 100%; }
.ad-slot--header { margin-block: 12px 0; }
.ad-slot .widget { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
.ad-slot .widget-title { display: none; }

/* ==========================================================================
   記事カード（一覧）
   ========================================================================== */
.post-list { display: grid; gap: 14px; }
.post-card {
	display: grid; grid-template-columns: 1fr; background: var(--c-surface); border: 1px solid var(--c-line);
	border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.post-card--has-thumb { grid-template-columns: 200px minmax(0, 1fr); }
.post-card__thumb { display: block; background: var(--c-line); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.post-card__body { padding: 14px 18px; min-width: 0; }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 6px; font-size: .78rem; color: var(--c-muted); }
.post-card__title { font-size: 1.05rem; margin: 0 0 4px; }
.post-card__title a { color: var(--c-text); text-decoration: none; }
.post-card__title a:hover { color: var(--c-brand); }
.post-card__excerpt { margin: 0; font-size: .85rem; color: var(--c-muted); line-height: 1.7; }

/* ==========================================================================
   ホーム：ハイライト
   ========================================================================== */
.home-intro { margin-bottom: 28px; }
.home-intro p { margin: 0; color: var(--c-muted); font-size: .9rem; }
.highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
.highlight { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 16px 18px; }
.highlight--new { border-top: 4px solid var(--c-new); }
.highlight--close { border-top: 4px solid var(--c-close); }
.highlight h2 { font-size: 1rem; margin-bottom: 8px; }
.highlight ul { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.highlight li { padding: 6px 0; border-top: 1px dashed var(--c-line); line-height: 1.55; }
.highlight li:first-child { border-top: 0; }
.highlight time { display: block; font-size: .72rem; color: var(--c-muted); }
.highlight a { color: var(--c-text); text-decoration: none; }
.highlight a:hover { color: var(--c-brand); }
.highlight__more { display: inline-block; margin-top: 8px; font-size: .8rem; }

/* ==========================================================================
   記事本文
   ========================================================================== */
.entry { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.entry__header { margin-bottom: 20px; }
.entry__title { font-size: 1.55rem; margin: 8px 0 8px; }
.entry__meta { font-size: .8rem; color: var(--c-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.entry__thumb { margin: 0 0 20px; }
.entry__content > * { margin-block: 0 1.1em; }
.entry__content p { margin-block: 0 .9em; }
.entry__content a:has(> img) { display: block; }
.entry__content img { border-radius: 4px; }
.entry__content h2 { font-size: 1.25rem; padding-bottom: 6px; border-bottom: 2px solid var(--c-line); margin-top: 1.8em; }
.entry__content h3 { font-size: 1.1rem; margin-top: 1.5em; }
.entry__content blockquote { margin-inline: 0; padding: 10px 16px; background: var(--c-bg); border-left: 4px solid var(--c-line); color: var(--c-muted); }
.entry__content table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.entry__content th, .entry__content td { border: 1px solid var(--c-line); padding: 8px 10px; text-align: left; }
.entry__content th { background: var(--c-bg); }
.entry__content iframe, .entry__content video { max-width: 100%; }
.alignleft { float: left; margin: 0 1em .5em 0; }
.alignright { float: right; margin: 0 0 .5em 1em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { font-size: .8rem; color: var(--c-muted); }

/* OSM プラグインの地図（インラインstyleで width:95% が付く） */
.osm-map-container { max-width: 100% !important; width: 100% !important; height: 360px !important; margin-block: 8px 1.2em; border-radius: var(--radius); border-color: var(--c-line) !important; }
.ol-popup { color: var(--c-text); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; font-size: .88rem; }
.post-nav a { display: block; padding: 12px 16px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); text-decoration: none; color: var(--c-text); }
.post-nav a:hover { border-color: var(--c-brand); }
.post-nav__next { text-align: right; grid-column: 2; }
.post-nav small { display: block; color: var(--c-muted); font-size: .72rem; }

.related { margin-top: 32px; }

/* ==========================================================================
   ページネーション
   ========================================================================== */
.pagination { margin-top: 28px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers {
	min-width: 40px; padding: 6px 12px; text-align: center; text-decoration: none; background: var(--c-surface);
	border: 1px solid var(--c-line); border-radius: var(--radius); color: var(--c-text); font-size: .9rem;
}
.pagination .page-numbers.current { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.pagination .dots { border: 0; background: none; }

/* ==========================================================================
   サイドバー・ウィジェット
   ========================================================================== */
.widget { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; font-size: .88rem; }
.widget-title,
.widget .wp-block-heading,
.widget > h2 { font-size: .95rem; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--c-brand); }
.widget .wp-block-search__label { font-size: .85rem; font-weight: 700; }
.widget .wp-block-search__button { white-space: nowrap; background: var(--c-brand); color: #fff; border: 0; border-radius: var(--radius); }
.widget .wp-block-search__input { border: 1px solid var(--c-line); border-radius: var(--radius); padding: 8px 10px; }
.widget .wp-block-latest-posts__list, .widget .wp-block-latest-comments, .widget .wp-block-archives-list, .widget .wp-block-categories-list { padding: 0; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 5px 0; border-top: 1px dashed var(--c-line); line-height: 1.55; }
.widget li:first-child { border-top: 0; }
.widget ul ul { margin-left: 12px; }
.widget a { text-decoration: none; }
.widget select { width: 100%; max-width: 100%; padding: 6px; }

.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--c-line); border-radius: var(--radius); font: inherit; font-size: .9rem; }
.search-form button, .button, .wpcf7-submit, input[type="submit"] {
	padding: 8px 18px; background: var(--c-brand); color: #fff; border: 0; border-radius: var(--radius); font: inherit; font-size: .9rem; cursor: pointer;
}
.search-form button:hover, .button:hover, .wpcf7-submit:hover, input[type="submit"]:hover { background: var(--c-brand-dark); }

/* ==========================================================================
   プラグイン連携（Contact Form 7 / TablePress / All-in-One Event Calendar）
   ========================================================================== */
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea {
	width: 100%; padding: 8px 10px; border: 1px solid var(--c-line); border-radius: var(--radius); font: inherit;
}
.wpcf7 p { margin-bottom: 1em; }
.tablepress { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tablepress th, .tablepress td { border: 1px solid var(--c-line); padding: 8px 10px; }
.tablepress thead th { background: var(--c-bg); }
.timely { font-size: .9rem; }
.timely img { max-width: none; }

/* ==========================================================================
   フッター
   ========================================================================== */
.site-footer { background: #17313f; color: #c7d5de; padding-block: 28px; font-size: .85rem; }
.site-footer a { color: #e5eef4; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px; }
.site-footer__copy { margin: 0; color: #93a8b6; font-size: .78rem; }

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 860px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.entry { padding: 20px 18px; }
	.entry__title { font-size: 1.3rem; }
	.highlights { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.site-header__top { grid-template-columns: minmax(0, 1fr) auto; }
	.menu-toggle { display: inline-block; }
	.main-nav { display: none; grid-column: 1 / -1; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav a { display: block; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
	.cat-nav ul { overflow-x: auto; flex-wrap: nowrap; }
	.cat-nav a { white-space: nowrap; }
	.post-card--has-thumb { grid-template-columns: 110px minmax(0, 1fr); }
	.post-card__body { padding: 10px 12px; }
	.post-card__excerpt { display: none; }
	.osm-map-container { height: 280px !important; }
}
