/*
Theme Name: Yahoo Portal Style
Theme URI: https://example.com/yahoo-portal-style
Author: Custom
Author URI: https://example.com
Description: Yahoo Japan風のポータルサイトを構築するためのWordPressテーマです。上部に検索窓と速報テッカー、左側に外部リンク／カテゴリーの2種類のメニュー、右側に自由配置できるウィジェットエリア、中央にカテゴリー別タブ（各タブに最新記事8件）、その下に全カテゴリーの新着記事をサムネイル付きで表示します。
Version: 1.0.0
Requires at least: 5.9
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yportal
*/

/* -----------------------------------------------------------
   0. Reset & variables
----------------------------------------------------------- */
:root {
  --yportal-bg: #f2f3f5;
  --yportal-panel-bg: #ffffff;
  --yportal-border: #dfe1e5;
  --yportal-text: #222222;
  --yportal-muted: #767676;
  --yportal-red: #d9272e;
  --yportal-orange: #ff8a00;
  --yportal-green: #2ea043;
  --yportal-tab-bg: #f6f6f7;
  --yportal-header-bg: #ffffff;
  --yportal-max-width: 1180px;
  --yportal-radius: 4px;
}

* { box-sizing: border-box; }

body.yportal {
  margin: 0;
  background: var(--yportal-bg);
  color: var(--yportal-text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

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

/* -----------------------------------------------------------
   1. Header (logo + search)
----------------------------------------------------------- */
.yportal-header {
  background: var(--yportal-header-bg);
  border-bottom: 3px solid var(--yportal-red);
}
.yportal-header-inner {
  max-width: var(--yportal-max-width);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.yportal-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--yportal-red);
  letter-spacing: .02em;
}
.yportal-searchbox { flex: 1 1 320px; max-width: 480px; margin-left: auto; }
.yportal-search-form {
  display: flex;
  border: 2px solid var(--yportal-red);
  border-radius: 999px;
  overflow: hidden;
}
.yportal-search-input {
  flex: 1;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  outline: none;
}
.yportal-search-submit {
  background: var(--yportal-red);
  color: #fff;
  border: none;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
}
.yportal-search-submit:hover { background: #b81f24; }

/* -----------------------------------------------------------
   2. Breaking-news ticker
----------------------------------------------------------- */
.yportal-ticker-wrap {
  background: #fff7f2;
  border-bottom: 1px solid var(--yportal-border);
  display: flex;
  align-items: center;
}
.yportal-ticker-label {
  flex: 0 0 auto;
  background: var(--yportal-red);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  letter-spacing: .05em;
}
.yportal-ticker {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.yportal-ticker-list {
  display: inline-flex;
  animation: yportal-marquee 28s linear infinite;
  padding-left: 100%;
}
.yportal-ticker:hover .yportal-ticker-list { animation-play-state: paused; }
.yportal-ticker-list li { margin-right: 48px; font-size: 13px; }
.yportal-ticker-list a,
.yportal-ticker-list span { color: var(--yportal-text); }
.yportal-ticker-list a:hover { text-decoration: underline; }
@keyframes yportal-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .yportal-ticker-list { animation: none; }
}

/* -----------------------------------------------------------
   3. Layout grid
----------------------------------------------------------- */
.yportal-container {
  max-width: var(--yportal-max-width);
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 200px minmax(0,1fr) 300px;
  gap: 20px;
  align-items: start;
}
.yportal-col-left, .yportal-col-right { min-width: 0; }

/* -----------------------------------------------------------
   4. Left column: menus
----------------------------------------------------------- */
.yportal-left-menu-box {
  background: var(--yportal-panel-bg);
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.yportal-menu-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  background: var(--yportal-tab-bg);
  border-bottom: 1px solid var(--yportal-border);
  padding: 8px 12px;
}
.yportal-menu { padding: 4px 0; }
.yportal-menu li a {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  border-bottom: 1px dotted #eee;
}
.yportal-menu li:last-child a { border-bottom: none; }
.yportal-menu li a:hover { color: var(--yportal-red); background: #fafafa; }

/* -----------------------------------------------------------
   5. Center column: tabs
----------------------------------------------------------- */
.yportal-tabs-box {
  background: var(--yportal-panel-bg);
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  margin-bottom: 20px;
}
.yportal-tabs-header {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: var(--yportal-tab-bg);
  border-bottom: 1px solid var(--yportal-border);
}
.yportal-tabs-header::-webkit-scrollbar { height: 5px; }
.yportal-tabs-header::-webkit-scrollbar-thumb { background: var(--yportal-border); border-radius: 3px; }
.yportal-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--yportal-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.yportal-tab:hover { color: var(--yportal-red); }
.yportal-tab.active {
  color: var(--yportal-red);
  border-bottom-color: var(--yportal-red);
  background: var(--yportal-panel-bg);
}
.yportal-tabs-updated {
  text-align: right;
  font-size: 11px;
  color: var(--yportal-muted);
  padding: 6px 14px 0;
}
.yportal-tab-panel { display: none; padding: 6px 4px 4px; }
.yportal-tab-panel.active { display: block; }

.yportal-headline-list { padding: 4px 10px 10px; }
.yportal-headline { border-bottom: 1px dotted #e5e5e5; }
.yportal-headline:last-child { border-bottom: none; }
.yportal-headline-link {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 4px;
  flex-wrap: wrap;
}
.yportal-headline-link:hover .yportal-headline-title { text-decoration: underline; }
.yportal-bullet { color: var(--yportal-red); flex: 0 0 auto; }
.yportal-headline-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  color: var(--yportal-text);
}
.yportal-badge {
  flex: 0 0 auto;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 1px 6px;
  border-radius: 2px;
  line-height: 1.5;
}
.yportal-badge-new { background: var(--yportal-orange); }
.yportal-badge-live {
  background: var(--yportal-green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.yportal-badge-live .dot {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
}
.yportal-comment-count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--yportal-muted);
}

.yportal-tabs-footer {
  display: flex;
  justify-content: flex-start;
  border-top: 1px solid var(--yportal-border);
  padding: 10px 14px;
  font-size: 13px;
}
.yportal-tabs-footer a:hover { text-decoration: underline; }
.yportal-more { color: var(--yportal-red); font-weight: 700; }
.yportal-topic-list { color: var(--yportal-muted); margin-left: auto; }

/* -----------------------------------------------------------
   5b. Main visual (hero banner: image / YouTube / slideshow)
----------------------------------------------------------- */
.yportal-mainvisual {
  --mv-aspect: 16/9;
  position: relative;
  width: 100%;
  aspect-ratio: var(--mv-aspect);
  border-radius: var(--yportal-radius);
  overflow: hidden;
  margin-bottom: 20px;
  background: #111;
}

.yportal-mv-slide {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  color: inherit;
}
.yportal-mv-image {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #14181f; /* fills any empty space so the whole image stays visible without cropping */
}
.yportal-mv-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 0 6%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 65%);
}
.yportal-mv-title {
  font-size: clamp(20px, 3.4vw, 34px);
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.yportal-mv-subtitle {
  font-size: clamp(12px, 1.4vw, 16px);
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

/* Static image mode */
.yportal-mv-mode-image .yportal-mv-slide { position: absolute; inset: 0; }

/* YouTube mode */
.yportal-mv-video-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none; /* background video: not interactive */
}
.yportal-mv-video {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Oversize + center-crop so a 16:9 iframe always fills any banner ratio */
  width: 177.78vh; /* 100 * 16/9 */
  height: 56.25vw; /* 100 * 9/16 */
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
}

/* Slideshow mode */
.yportal-mv-slideshow { position: absolute; inset: 0; }
.yportal-mv-slideshow .yportal-mv-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
}
.yportal-mv-slideshow .yportal-mv-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}
.yportal-mv-dots {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.yportal-mv-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  cursor: pointer;
}
.yportal-mv-dot.is-active { background: #fff; }

@media (max-width: 782px) {
  .yportal-mv-text { padding: 0 5%; background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.45) 100%); }
}

/* -----------------------------------------------------------
   6. Center column: all-category latest w/ thumbnails
----------------------------------------------------------- */
.yportal-allcat-box {
  background: var(--yportal-panel-bg);
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  padding: 16px;
}
.yportal-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  border-left: 4px solid var(--yportal-red);
  padding-left: 8px;
}
.yportal-newcards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 24px;
}
.yportal-newcard { display: block; color: inherit; }
.yportal-newcard-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--yportal-radius);
  overflow: hidden;
  background: #eee;
  margin-bottom: 10px;
}
.yportal-newcard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.yportal-thumb-placeholder { width: 100%; height: 100%; background: #e2e4e7; }

.yportal-newcard-cat-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.yportal-newcard-cat-badge .yportal-cat-icon { color: #fff; flex: 0 0 auto; }
.yportal-newcard-cat-name { color: #fff; }

.yportal-newcard-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  transition: opacity .3s ease, background-color .3s ease;
}
.yportal-newcard-readmore {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .12em;
  transform: translateY(6px);
  transition: transform .3s ease;
}
.yportal-newcard:hover .yportal-newcard-overlay {
  opacity: 1;
  background-color: rgba(0, 0, 0, .45);
}
.yportal-newcard:hover .yportal-newcard-thumb img { transform: scale(1.08); }
.yportal-newcard:hover .yportal-newcard-readmore { transform: translateY(0); }

.yportal-newcard-dates {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--yportal-muted);
  margin-bottom: 6px;
}
.yportal-newcard-date, .yportal-newcard-updated { display: inline-flex; align-items: center; gap: 4px; }
.yportal-newcard-title {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--yportal-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yportal-newcard:hover .yportal-newcard-title { text-decoration: underline; }
.yportal-newcard-excerpt {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--yportal-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -----------------------------------------------------------
   7. Right column: freely placed widgets
----------------------------------------------------------- */
.yportal-widget {
  background: var(--yportal-panel-bg);
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  margin-bottom: 16px;
  padding: 12px;
}
.yportal-widget-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--yportal-border);
  padding-bottom: 8px;
}
.yportal-widget img { border-radius: var(--yportal-radius); margin-bottom: 6px; }
.yportal-widget-placeholder p { color: var(--yportal-muted); font-size: 12px; }

/* widgets: small text lists inside widgets look consistent */
.yportal-widget ul li { padding: 5px 0; border-bottom: 1px dotted #eee; font-size: 12.5px; }
.yportal-widget ul li:last-child { border-bottom: none; }

.yportal-widget-cat-dropdown {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 6px 8px;
  font-size: 12.5px;
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  background: #fff;
  color: var(--yportal-text);
}

.yportal-filtered-search-form {
  display: flex;
  gap: 6px;
}
.yportal-filtered-search-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 12.5px;
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
}
.yportal-filtered-search-submit {
  flex: 0 0 auto;
  padding: 0 14px;
  border: none;
  border-radius: var(--yportal-radius);
  background: var(--yportal-red);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}
.yportal-filtered-search-submit:hover { background: #b81f24; }

.yportal-search-scope-note {
  margin: -8px 0 16px;
  font-size: 12px;
  color: var(--yportal-muted);
}

/* Icon-row widget areas (メインエリア上部/下部, トップページ上部/下部) --
   each "ポータル: アイコン" widget shows up to 3 icons itself, so the
   outer area just stacks/wraps multiple widget instances. */
.yportal-icon-row {
  max-width: var(--yportal-max-width);
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.yportal-icon-row-item { width: 100%; }

/* The icon widget itself: up to 3 icon+title+link items, side by side,
   sharing the available width equally -- works in narrow sidebars and
   wide banner areas alike. */
.yportal-icon-widget-row {
  display: flex;
  gap: 10px;
}
.yportal-icon-widget-link {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-align: center;
}
.yportal-icon-widget-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--yportal-text);
}
.yportal-icon-widget-icon svg { width: 100%; height: 100%; }
.yportal-icon-widget-link:hover .yportal-icon-widget-icon { color: var(--yportal-red); }
.yportal-icon-widget-title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--yportal-text);
}

/* Sticky sidebar wrapper (holds e.g. the Profile widget) */
.yportal-sticky-sidebar {
  position: sticky;
  top: 16px;
}

/* Profile widget */
.yportal-profile-card {
  margin: -12px; /* cancel .yportal-widget's own padding so the cover image can bleed to the edges */
  overflow: hidden;
  border-radius: var(--yportal-radius);
}
.yportal-profile-kicker {
  margin: 12px 12px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--yportal-text);
}
.yportal-profile-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #e2e4e7;
}
.yportal-profile-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.yportal-profile-icon-wrap {
  position: absolute;
  left: 50%;
  bottom: -75px;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid var(--yportal-panel-bg);
  background: var(--yportal-panel-bg);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.yportal-profile-icon { width: 100%; height: 100%; object-fit: cover; display: block; }

.yportal-profile-icon-standalone {
  display: flex;
  justify-content: center;
  padding-top: 16px;
}
.yportal-profile-icon-standalone .yportal-profile-icon {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.yportal-profile-body { padding: 16px; text-align: center; }
.yportal-profile-media + .yportal-profile-body { padding-top: 85px; }
.yportal-profile-name { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--yportal-text); }

.yportal-profile-sns {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.yportal-profile-sns-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
}
.yportal-profile-sns-icon:hover { opacity: .85; }
.yportal-sns-icon-facebook  { background: #3b5998; }
.yportal-sns-icon-x         { background: #000000; }
.yportal-sns-icon-instagram { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.yportal-sns-icon-youtube   { background: #ff0000; }
.yportal-sns-icon-other     { background: #34a853; }

.yportal-profile-text {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--yportal-muted);
  text-align: left;
}
.yportal-profile-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--yportal-radius);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.yportal-profile-btn:hover { opacity: .9; }

/* -----------------------------------------------------------
   8. Standard content (single / page / category / index)
----------------------------------------------------------- */
.yportal-content-wrap {
  max-width: var(--yportal-max-width);
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 20px;
  align-items: start;
}
.yportal-article-list-box,
.yportal-single-box {
  background: var(--yportal-panel-bg);
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  padding: 20px;
}
.yportal-archive-title {
  font-size: 18px;
  border-left: 4px solid var(--yportal-red);
  padding-left: 10px;
  margin: 0 0 16px;
}
.yportal-post-card {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dotted #e5e5e5;
}
.yportal-post-card:first-child { padding-top: 0; }
.yportal-post-card:last-child { border-bottom: none; }
.yportal-post-card-thumb { flex: 0 0 140px; border-radius: var(--yportal-radius); overflow: hidden; aspect-ratio: 4/3; background: #eee; }
.yportal-post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yportal-post-card-body h2 { font-size: 15px; margin: 0 0 6px; }
.yportal-post-card-body .yportal-excerpt { font-size: 13px; color: var(--yportal-muted); }
.yportal-post-meta { font-size: 11px; color: var(--yportal-muted); margin-top: 6px; }

.yportal-single-title { font-size: 22px; margin: 0 0 8px; }
/* Category / tag badges */
.yportal-terms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0 14px;
}
.yportal-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 4px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}
.yportal-cat-badge:hover { opacity: .85; }
.yportal-cat-icon { flex: 0 0 auto; color: #fff; }
.yportal-cat-name { color: #fff; }
.yportal-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 4px;
  background: #f2f3f5;
  border: 1px solid var(--yportal-border);
  color: var(--yportal-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.yportal-tag-badge:hover { background: #e9eaec; color: var(--yportal-text); }
.yportal-tag-icon { flex: 0 0 auto; color: var(--yportal-muted); }
.yportal-tag-badge:hover .yportal-tag-icon { color: var(--yportal-text); }

.yportal-single-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--yportal-muted); margin-bottom: 16px; border-bottom: 1px solid var(--yportal-border); padding-bottom: 12px; }
.yportal-single-thumb {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
  border-radius: var(--yportal-radius);
  overflow: hidden;
  background: #eee;
}
.yportal-single-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.yportal-single-body { font-size: 15px; line-height: 1.9; }
.yportal-single-body p { margin: 0 0 1.2em; }

/* SNS share buttons */
.yportal-sns-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.yportal-sns-share-top { padding-bottom: 16px; border-bottom: 1px solid var(--yportal-border); }
.yportal-sns-share-bottom { padding-top: 16px; border-top: 1px solid var(--yportal-border); }
.yportal-sns-caption { font-size: 12px; font-weight: 700; color: var(--yportal-muted); flex: 0 0 auto; }
.yportal-sns-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.yportal-sns-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}
.yportal-sns-btn:hover { opacity: .88; }
.yportal-sns-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .25);
  font-size: 10.5px;
  font-weight: 800;
}
.yportal-sns-facebook   { background: #3b5998; }
.yportal-sns-twitter    { background: #1da1f2; }
.yportal-sns-googleplus { background: #dd4b39; }
.yportal-sns-hatena     { background: #00a4de; }
.yportal-sns-pocket     { background: #ef4056; }
.yportal-sns-line       { background: #00b900; }
.yportal-sns-linkedin   { background: #0077b5; }
.yportal-sns-pinterest  { background: #bd081c; }

.yportal-pagination { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.yportal-pagination a, .yportal-pagination span {
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  padding: 6px 12px;
  font-size: 13px;
}
.yportal-pagination .current { background: var(--yportal-red); color: #fff; border-color: var(--yportal-red); }

/* -----------------------------------------------------------
   8b. Topics list page (page-topics.php)
----------------------------------------------------------- */
.yportal-topics-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.yportal-topics-title {
  margin: 0;
  font-size: 18px;
  border-left: 4px solid var(--yportal-red);
  padding-left: 10px;
}
.yportal-topics-view-nav { font-size: 13px; }
.yportal-topics-view-nav a { color: var(--yportal-muted); }
.yportal-topics-view-nav a.active { color: var(--yportal-red); font-weight: 700; }
.yportal-topics-view-nav a:hover { text-decoration: underline; }
.yportal-topics-nav-sep { color: var(--yportal-border); margin: 0 4px; }

/* by-category grouped view */
.yportal-topics-bycat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}
.yportal-topics-bycat-section { min-width: 0; }
.yportal-topics-bycat-title {
  margin: 0 0 4px;
  font-size: 15px;
  border-left: 4px solid var(--yportal-red);
  padding-left: 8px;
}
.yportal-topics-bycat-title a:hover { text-decoration: underline; }
.yportal-topics-bycat-section .yportal-headline-list { padding: 0; }
.yportal-topics-bycat-more { text-align: right; font-size: 12.5px; margin-top: 4px; }
.yportal-topics-bycat-more a { color: var(--yportal-red); font-weight: 700; }
.yportal-topics-bycat-more a:hover { text-decoration: underline; }

/* flat "all categories" list view */
.yportal-topics-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: var(--yportal-tab-bg);
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  margin-bottom: 12px;
}
.yportal-topics-tabs::-webkit-scrollbar { height: 5px; }
.yportal-topics-tabs::-webkit-scrollbar-thumb { background: var(--yportal-border); border-radius: 3px; }
.yportal-topics-tabs a {
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--yportal-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.yportal-topics-tabs a:hover { color: var(--yportal-red); }
.yportal-topics-tabs a.active {
  color: var(--yportal-red);
  border-bottom-color: var(--yportal-red);
  background: var(--yportal-panel-bg);
}

.yportal-topics-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--yportal-muted);
  padding: 4px 2px 10px;
}
.yportal-topics-filter select {
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  padding: 5px 8px;
  font-size: 12.5px;
  background: #fff;
  color: var(--yportal-text);
}

.yportal-topics-list { border-top: 1px solid var(--yportal-border); }
.yportal-topics-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px dotted #e5e5e5;
}
.yportal-topics-row:hover .yportal-topics-row-title { text-decoration: underline; }
.yportal-topics-row-thumb {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: var(--yportal-radius);
  overflow: hidden;
  background: #eee;
}
.yportal-topics-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yportal-topics-row-body { min-width: 0; }
.yportal-topics-row-title {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--yportal-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yportal-topics-row-date { margin: 0; font-size: 11.5px; color: var(--yportal-muted); }

@media (max-width: 700px) {
  .yportal-topics-bycat-grid { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------
   9. Footer
----------------------------------------------------------- */
.yportal-footer {
  background: #2b2b2b;
  color: #ccc;
  margin-top: 30px;
  padding: 30px 16px 20px;
}
.yportal-big-footer {
  max-width: var(--yportal-max-width);
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #444;
}
.yportal-big-footer-col { min-width: 0; }
.yportal-big-footer-col .yportal-widget { background: #363636; border-color: #444; color: #ccc; }
.yportal-big-footer-col .yportal-widget-title { color: #fff; border-color: #4a4a4a; }
.yportal-footer-widgets {
  max-width: var(--yportal-max-width);
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.yportal-footer-widgets .yportal-widget { background: #363636; border-color: #444; color: #ccc; }
.yportal-footer-widgets .yportal-widget-title { color: #fff; border-color: #4a4a4a; }
.yportal-footer-menu {
  max-width: var(--yportal-max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #444;
  font-size: 12px;
}
.yportal-footer-menu a:hover { text-decoration: underline; }
.yportal-copyright {
  max-width: var(--yportal-max-width);
  margin: 14px auto 0;
  font-size: 11px;
  color: #999;
  text-align: center;
}

/* -----------------------------------------------------------
   9b. Membership (login / register / mypage / content gate)
----------------------------------------------------------- */
.yportal-member-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.yportal-member-greeting {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 100%;
  margin: 0 0 2px;
  font-size: 12.5px;
  color: var(--yportal-muted);
}
.yportal-member-avatar { border-radius: 50%; flex: 0 0 auto; }
.yportal-member-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  padding: 8px 12px;
  border-radius: var(--yportal-radius);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
}
.yportal-member-btn-primary { background: var(--yportal-red); color: #fff; }
.yportal-member-btn-primary:hover { background: #b81f24; }
.yportal-member-btn-secondary { background: #fff; color: var(--yportal-red); border-color: var(--yportal-red); }
.yportal-member-btn-secondary:hover { background: #fff7f2; }
.yportal-member-btn-block { display: flex; width: 100%; }

/* Login / register / mypage forms */
.yportal-member-form-box {
  max-width: 440px;
  margin: 0 auto;
}
.yportal-mypage-box { max-width: 520px; }
.yportal-member-form-title {
  margin: 0 0 20px;
  font-size: 20px;
  text-align: center;
}
.yportal-mypage-section-title {
  margin: 28px 0 14px;
  font-size: 15px;
  border-left: 4px solid var(--yportal-red);
  padding-left: 8px;
}

/* Mypage tabs (お気に入り / マイアカウント) */
.yportal-mypage-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--yportal-border);
}
.yportal-mypage-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--yportal-muted);
  cursor: pointer;
}
.yportal-mypage-tab:hover { color: var(--yportal-red); }
.yportal-mypage-tab.active { color: var(--yportal-red); border-bottom-color: var(--yportal-red); }
.yportal-mypage-tab-panel { display: none; }
.yportal-mypage-tab-panel.active { display: block; }

.yportal-mypage-favorites-placeholder {
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed var(--yportal-border);
  border-radius: var(--yportal-radius);
  background: #fafafa;
}
.yportal-mypage-favorites-title { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.yportal-mypage-favorites-text { margin: 0; font-size: 13px; color: var(--yportal-muted); line-height: 1.7; }

/* Favorite (bookmark) button on single post pages */
.yportal-favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--yportal-border);
  border-radius: 999px;
  background: #fff;
  color: var(--yportal-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.yportal-favorite-btn:hover { border-color: var(--yportal-red); color: var(--yportal-red); }
.yportal-favorite-btn.is-favorited { background: #fff0f0; border-color: var(--yportal-red); color: var(--yportal-red); }
.yportal-favorite-icon { display: inline-flex; }

/* Favorites grid grouped by category (mypage) */
.yportal-favorites-group { margin-bottom: 28px; }
.yportal-favorites-group-title {
  margin: 0 0 12px;
  font-size: 14px;
  border-left: 4px solid var(--yportal-red);
  padding-left: 8px;
}
.yportal-favorites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.yportal-favorites-card { display: block; }
.yportal-favorites-card-thumb {
  aspect-ratio: 4 / 3;
  background: #eee;
  border-radius: var(--yportal-radius);
  overflow: hidden;
  margin-bottom: 6px;
}
.yportal-favorites-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yportal-favorites-card-title {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--yportal-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yportal-favorites-card:hover .yportal-favorites-card-title { text-decoration: underline; }

/* Avatar upload field (mypage) */
.yportal-avatar-field {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.yportal-avatar-preview {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: #eee;
}
.yportal-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yportal-avatar-controls { flex: 1 1 auto; min-width: 0; }
.yportal-avatar-upload-label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--yportal-text);
}
.yportal-avatar-controls input[type="file"] {
  display: block;
  width: 100%;
  font-size: 12.5px;
}
.yportal-avatar-controls .description { margin: 6px 0 0; font-size: 11.5px; color: var(--yportal-muted); }
.yportal-avatar-remove { display: block; margin-top: 8px; font-size: 12px; color: var(--yportal-muted); }

@media (max-width: 600px) {
  .yportal-favorites-grid { grid-template-columns: repeat(2, 1fr); }
}

.yportal-member-form-error,
.yportal-member-form-success {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--yportal-radius);
  font-size: 13px;
}
.yportal-member-form-error { background: #fdeceb; color: #b81f24; border: 1px solid #f3c2c0; }
.yportal-member-form-success { background: #eaf7ee; color: #1f7a3d; border: 1px solid #bfe6cb; }

.yportal-form-field { margin: 0 0 14px; }
.yportal-form-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--yportal-text);
}
.yportal-form-field input[type="text"],
.yportal-form-field input[type="email"],
.yportal-form-field input[type="password"],
.yportal-form-field textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  background: #fff;
}
.yportal-form-field textarea { resize: vertical; }
.yportal-form-checkbox { margin: 0 0 18px; font-size: 12.5px; }
.yportal-form-submit { margin: 0 0 6px; }
.yportal-form-honeypot { position: absolute; left: -9999px; top: -9999px; }

.yportal-member-form-links {
  margin-top: 16px;
  font-size: 12.5px;
  text-align: center;
  color: var(--yportal-muted);
}
.yportal-member-form-links a:hover { text-decoration: underline; }
.yportal-member-form-links-sep { margin: 0 8px; color: var(--yportal-border); }

.yportal-member-form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px;
  font-size: 12px;
  color: var(--yportal-muted);
}
.yportal-member-form-divider::before,
.yportal-member-form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--yportal-border);
}
.yportal-google-btn-wrap { display: flex; justify-content: center; }

/* Member-only content gate (shown to logged-out visitors on restricted posts) */
.yportal-member-gate {
  margin-top: 12px;
  padding: 24px 20px;
  border: 1px solid var(--yportal-border);
  border-radius: var(--yportal-radius);
  background: #fafafa;
  text-align: center;
}
.yportal-member-gate-title { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.yportal-member-gate-text { margin: 0 0 16px; font-size: 13px; color: var(--yportal-muted); }
.yportal-member-gate-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.yportal-member-gate-buttons .yportal-member-btn { flex: 0 0 auto; min-width: 140px; }

/* "会員限定" badge, usable in headline lists */
.yportal-member-only-badge {
  display: inline-block;
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 2px;
  background: #333;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* -----------------------------------------------------------
   10. Mobile hamburger menu (header button + off-canvas drawer)
----------------------------------------------------------- */
.yportal-hamburger-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  padding: 4px 0 5px;
  border: none;
  background: transparent;
  cursor: pointer;
}
.yportal-hamburger-icon {
  position: relative;
  width: 22px;
  height: 14px;
}
.yportal-hamburger-icon,
.yportal-hamburger-icon::before,
.yportal-hamburger-icon::after {
  display: block;
}
.yportal-hamburger-icon::before,
.yportal-hamburger-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
}
.yportal-hamburger-icon {
  border-top: 2px solid var(--yportal-text);
  border-bottom: 2px solid var(--yportal-text);
}
.yportal-hamburger-icon::before {
  top: 50%;
  margin-top: -1px;
  height: 2px;
  background: var(--yportal-text);
}

.yportal-mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0);
  opacity: 0;
  transition: opacity .3s ease, background-color .3s ease;
}
.yportal-mobile-menu-backdrop.is-open { background-color: rgba(0, 0, 0, .4); opacity: 1; }

.yportal-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10000;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--yportal-panel-bg);
  box-shadow: -2px 0 14px rgba(0, 0, 0, .15);
  transform: translateX(100%);
  transition: transform .3s ease;
  overflow-y: auto;
}
.yportal-mobile-menu.is-open { transform: translateX(0); }
.yportal-mobile-menu-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--yportal-panel-bg);
  border-bottom: 1px solid var(--yportal-border);
}
.yportal-mobile-menu-title { font-size: 14px; font-weight: 700; }
.yportal-mobile-menu-close {
  border: none;
  background: none;
  padding: 0 4px;
  font-size: 26px;
  line-height: 1;
  color: var(--yportal-muted);
  cursor: pointer;
}
.yportal-mobile-menu-body { padding: 12px 16px 28px; }
.yportal-mobile-menu-body .yportal-left-menu-box { margin-bottom: 16px; }

body.yportal-no-scroll { overflow: hidden; }

/* -----------------------------------------------------------
   11. Responsive
----------------------------------------------------------- */
@media (max-width: 980px) {
  .yportal-container { grid-template-columns: 1fr; }
  .yportal-col-left { display: none; } /* moved into the hamburger drawer on mobile */
  .yportal-col-center { order: 1; }
  .yportal-col-right { order: 2; }
  .yportal-content-wrap { grid-template-columns: 1fr; }
  .yportal-sticky-sidebar { position: static; } /* avoid a floating card while columns are stacked */
  .yportal-big-footer { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .yportal-big-footer { grid-template-columns: 1fr; }

  .yportal-newcards-grid { gap: 18px 12px; }
  .yportal-newcard-title { font-size: 13px; -webkit-line-clamp: 3; }
  .yportal-newcard-cat-badge { font-size: 10px; padding: 4px 7px; }
  /* Per request: on mobile the "新着記事" cards stay 2-up but drop the
     excerpt text and the hover-only "READ MORE" zoom effect (hover has
     no reliable equivalent on touch, and can visually "stick"). */
  .yportal-newcard-excerpt { display: none; }
  .yportal-newcard-overlay { display: none; }
  .yportal-newcard:hover .yportal-newcard-thumb img { transform: none; }

  .yportal-searchbox { max-width: none; flex-basis: 100%; margin-left: 0; order: 3; }
  .yportal-header-inner { flex-wrap: wrap; }

  .yportal-post-card { flex-direction: column; }
  .yportal-post-card-thumb { flex-basis: auto; width: 100%; }

  .yportal-sns-caption { flex-basis: 100%; }
  .yportal-sns-btn { padding: 6px 10px; font-size: 11.5px; }
}
