/*
Theme Name: Affiliate Sample Theme
Description: アフィリエイトサイト配布用カスタムテーマ（daiso-theme ベース）
Version: 1.1.0
Author: oceanbluese
Text Domain: affiliate-sample-theme
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+JP:wght@400;500;600;700;800;900&display=swap');

:root {
  --brand:        #E87AAA;
  --brand-dark:   #CC5588;
  --brand-light:  #F098C0;
  --accent:       #F0C030;
  --white:        #ffffff;
  --bg:           #FEF7FA;
  --text:         #333333;
  --gray:         #999999;
  --border:       #F0D8E4;
  --navy:         #3A2A40;
  --radius:       8px;
  --shadow:       0 2px 12px rgba(0,0,0,.07);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.11);
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px;  --space-7: 32px; --space-8: 40px;
  --space-9: 48px; --space-10: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-size: 15px; line-height: 1.8;
  color: var(--text); background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ===== Layout ===== */
.site-container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.site-header .site-container,
.site-footer .site-container { padding-block: 0; }
.content-wrap { display: flex; gap: 32px; padding: 32px 0; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 280px; flex-shrink: 0; }

/* ===== Header ===== */
.site-header {
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.site-logo a {
  display: flex; align-items: center;
  text-decoration: none; line-height: 1;
}
.site-logo-text {
  font-size: 20px; font-weight: 900; color: #fff;
  letter-spacing: -.02em;
}
.site-nav ul { display: flex; list-style: none; gap: 4px; }
.site-nav a {
  color: rgba(255,255,255,.9); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 4px; text-decoration: none;
  transition: background .15s;
}
.site-nav a:hover { background: rgba(255,255,255,.15); color: var(--white); }
.header-search form { display: flex; }
.header-search input {
  padding: 6px 12px; border: none; border-radius: 20px 0 0 20px;
  font-size: 13px; width: 160px; outline: none;
}
.header-search button {
  background: var(--accent); border: none; border-radius: 0 20px 20px 0;
  padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.hamburger-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger-btn span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px; transition: .2s;
}

/* ===== Mobile Nav ===== */
.mobile-nav-overlay {
  display: none; position: fixed; inset: 64px 0 0;
  background: var(--navy); z-index: 99; overflow-y: auto; padding: 16px;
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav-overlay ul { list-style: none; }
.mobile-nav-overlay li a {
  display: block; padding: 12px 8px;
  color: #fff; border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 15px;
}
.mobile-search { margin-bottom: 16px; }
.mobile-search form { display: flex; }
.mobile-search input {
  flex: 1; padding: 10px 14px; border: none; border-radius: 6px 0 0 6px;
  font-size: 14px; outline: none;
}
.mobile-search button {
  background: var(--accent); border: none; border-radius: 0 6px 6px 0;
  padding: 10px 14px; cursor: pointer; font-size: 14px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: var(--white); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--gray);
}
.breadcrumb .site-container { padding-block: 8px; }
.breadcrumb a { color: var(--gray); }
.breadcrumb span { margin: 0 6px; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 50%, var(--brand-light) 100%);
  color: var(--white); padding: 64px 16px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 24px 24px;
}
.hero-inner {
  position: relative; max-width: 680px; text-align: center; margin: 0 auto;
}
.hero-eyebrow {
  display: inline-block; background: var(--accent); color: #333;
  font-size: 12px; font-weight: 700; padding: 3px 12px;
  border-radius: 20px; margin-bottom: 16px; letter-spacing: .08em;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px); font-weight: 900; line-height: 1.2;
  letter-spacing: -.02em; margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.h1-accent { color: var(--accent); }
.hero-lead {
  font-size: 16px; font-weight: 500; opacity: .95; margin-bottom: 8px;
}
.hero-note {
  font-size: 13px; opacity: .75; margin-bottom: 28px;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 28px; border-radius: 24px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  transition: transform .15s, box-shadow .15s; cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.2); text-decoration: none; }
.btn-white  { background: var(--white); color: var(--brand); }
.btn-accent { background: var(--accent); color: #333; }
.btn-brand  { background: var(--brand); color: var(--white); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.7); }

/* ===== Stats Bar ===== */
.stats-bar {
  background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 0;
}
.stats-bar .site-container {
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num { font-size: 22px; font-weight: 900; color: var(--brand); }
.stat-label { font-size: 11px; color: var(--gray); }

/* ===== Sections ===== */
.section { padding: 48px 0; }
.section-alt { background: var(--white); }
.section-header { text-align: center; margin-bottom: 36px; }
.section-header h2 {
  font-size: 22px; font-weight: 900; color: var(--text);
  display: inline-flex; align-items: center; gap: 10px;
}
.section-header h2::before,
.section-header h2::after {
  content: ''; display: inline-block; width: 36px; height: 3px;
  background: var(--brand); border-radius: 2px;
}
.section-header p { color: var(--gray); font-size: 13px; margin-top: 8px; }

/* ===== Category Grid ===== */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px;
}
.category-card {
  background: var(--white); border-radius: var(--radius);
  padding: 24px 12px 20px; text-align: center;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  text-decoration: none; color: var(--text); display: block;
  border-top: 3px solid var(--border);
}
.category-card:hover {
  transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12);
  border-top-color: var(--brand); text-decoration: none; color: var(--text);
}
.category-card .cat-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.category-card .cat-name { font-size: 13px; font-weight: 700; line-height: 1.4; }
.category-card .cat-count { font-size: 11px; color: var(--gray); margin-top: 4px; }

/* ===== Post Cards ===== */
.posts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px;
}
.post-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.post-card-thumb { aspect-ratio: 16/9; overflow: hidden; background: #f0f0f0; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-thumb .no-thumb {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 48px;
}
.post-card-body { padding: 16px; }
.post-card-cat {
  display: inline-block; background: var(--brand); color: var(--white);
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  margin-bottom: 8px; text-decoration: none;
}
.post-card-cat:hover { background: var(--brand-dark); color: var(--white); }
.post-card-title {
  font-size: 14px; font-weight: 700; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--brand); text-decoration: none; }
.post-card-meta { font-size: 12px; color: var(--gray); }

/* ===== Pagination ===== */
.pagination { margin-top: 32px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 6px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  background: var(--white); color: var(--text); box-shadow: var(--shadow);
}
.pagination .current { background: var(--brand); color: var(--white); }
.pagination a:hover { background: var(--brand-light); color: var(--white); text-decoration: none; }

/* ===== Category Banner ===== */
.cat-page-banner {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: var(--white); padding: 40px 16px; text-align: center; margin-bottom: 8px;
}
.cat-page-banner .cat-page-banner-icon { font-size: 48px; margin-bottom: 8px; }
.cat-page-banner h1 { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
.cat-page-banner p { opacity: .9; font-size: 14px; }

/* ===== Archive Header ===== */
.archive-header { margin-bottom: 24px; }
.archive-title { font-size: 22px; font-weight: 900; color: var(--text); }

/* ===== Post (single) ===== */
.post-header {
  background: var(--white); padding: 28px; border-radius: var(--radius);
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.post-cats { margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.post-cat-badge {
  display: inline-block; background: var(--brand); color: var(--white);
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 3px;
  text-decoration: none;
}
.post-title { font-size: clamp(18px, 3vw, 26px); font-weight: 900; line-height: 1.4; margin-bottom: 12px; }
.post-meta { font-size: 13px; color: var(--gray); display: flex; gap: 16px; flex-wrap: wrap; }

.post-content {
  background: var(--white); padding: 28px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.post-content h2 {
  font-size: 19px; font-weight: 900;
  border-left: 4px solid var(--brand); padding-left: 12px;
  margin: 28px 0 14px;
}
.post-content h3 {
  font-size: 16px; font-weight: 700;
  border-bottom: 2px solid var(--border); padding-bottom: 6px;
  margin: 22px 0 12px;
}
.post-content p { margin-bottom: 16px; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 16px; }
.post-content li { margin-bottom: 6px; }
.post-content img { border-radius: var(--radius); margin: 16px 0; }
.post-content a { text-decoration: underline; }

/* Affiliate disclosure box */
.affiliate-box {
  background: #fff8f0; border: 1px solid #ffe0b2; border-radius: var(--radius);
  padding: 16px 20px; margin-top: 24px; font-size: 13px; color: #666;
}
.affiliate-box p { margin-bottom: 10px; }

/* Amazon box in posts */
.amazon-box {
  background: #fffbf0; border: 2px solid #f0c030; border-radius: var(--radius);
  margin: 24px 0;
}
.amazon-box-inner { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.amazon-box-label { font-size: 14px; font-weight: 700; }
.btn-amazon {
  background: #ff9900; color: #111; border-radius: 6px;
  padding: 8px 20px; font-size: 13px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.btn-amazon:hover { background: #e68900; color: #111; text-decoration: none; transform: none; }

/* ===== Sidebar ===== */
.widget {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden;
}
.widget-title {
  font-size: 13px; font-weight: 700;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  color: var(--white); padding: 10px 16px; margin-bottom: 0;
}
.widget ul { list-style: none; padding: 12px 16px; }
.widget ul li { border-bottom: 1px solid var(--border); }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; font-size: 13px; color: var(--text); text-decoration: none;
}
.widget ul li a:hover { color: var(--brand); }
.cat-count-badge {
  background: var(--border); color: var(--gray);
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}

/* Amazon sidebar widget */
.amazon-sidebar-widget .widget-body { padding: 14px 16px; }
.amazon-logo-text {
  font-size: 16px; font-weight: 900; color: #ff9900;
  letter-spacing: -.02em;
}
.amazon-sidebar-desc { font-size: 12px; color: var(--gray); margin: 6px 0 10px; }
.amazon-links { list-style: none !important; padding: 0 !important; }
.amazon-links li { border-bottom: 1px solid var(--border); }
.amazon-links li a { font-size: 13px; color: var(--text); padding: 8px 0; display: block; }
.amazon-links li a:hover { color: var(--brand); }
.widget-contact p { font-size: 13px; padding: 12px 16px 0; color: var(--gray); }
.widget-contact .btn { margin: 10px 16px 14px; width: calc(100% - 32px); justify-content: center; font-size: 13px; }

/* ===== Page (static) ===== */
.page-content {
  background: var(--white); padding: 28px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page-title { font-size: 22px; font-weight: 900; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.entry-content p { margin-bottom: 16px; }
.entry-content h2 { font-size: 18px; font-weight: 900; margin: 24px 0 12px; border-left: 4px solid var(--brand); padding-left: 10px; }

/* ===== Footer ===== */
.site-footer {
  background: var(--navy); color: rgba(255,255,255,.75);
  padding: 40px 0 0; margin-top: 40px;
}
.footer-main {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; padding: 0 0 32px;
}
.footer-brand .brand-name { font-size: 18px; font-weight: 900; color: var(--white); margin-bottom: 10px; }
.brand-desc { font-size: 13px; line-height: 1.8; }
.footer-col h4 { font-size: 12px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { font-size: 13px; color: rgba(255,255,255,.6); }
.footer-col a:hover { color: var(--white); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 16px 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.4);
}
.footer-bottom p { margin-bottom: 4px; }

/* ===== Contact Form 7 ===== */
.contact-page .wpcf7 { margin-top: 8px; }
.contact-form-inner .wpcf7-form p {
  margin-bottom: 18px;
}
.contact-form-inner .wpcf7-form label,
.contact-form-inner .wpcf7-form p > :first-child {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.contact-form-inner input[type="text"],
.contact-form-inner input[type="email"],
.contact-form-inner textarea {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s; background: #fff;
}
.contact-form-inner input[type="text"]:focus,
.contact-form-inner input[type="email"]:focus,
.contact-form-inner textarea:focus {
  border-color: var(--brand);
}
.contact-form-inner textarea { min-height: 140px; resize: vertical; }
.contact-form-inner .wpcf7-submit {
  background: var(--brand); color: #fff;
  border: none; border-radius: 24px;
  padding: 12px 36px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .15s, transform .15s;
}
.contact-form-inner .wpcf7-submit:hover {
  background: var(--brand-dark); transform: translateY(-2px);
}
.wpcf7-not-valid-tip { color: #e05; font-size: 12px; margin-top: 4px; display: block; }
.wpcf7-response-output {
  margin-top: 16px; padding: 12px 16px;
  border-radius: var(--radius); font-size: 13px;
}
.wpcf7-mail-sent-ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.wpcf7-validation-errors { background: #fff3e0; border: 1px solid #ffcc02; color: #e65100; }
.wpcf7-spam-blocked { background: #fce4ec; border: 1px solid #f48fb1; color: #c62828; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-nav, .header-search { display: none; }
  .hamburger-btn { display: flex; }
  .content-wrap { flex-direction: column; }
  .sidebar { width: 100%; }
  .hero { padding: 40px 16px; }
  .footer-main { grid-template-columns: 1fr; gap: 24px; }
  .stats-bar .site-container { gap: 24px; }
}


/*
 * Portal Design System for affiliate-sample-theme
 * Shared with machi-create.com portal visual language.
 * Version: 1.1.0
 */

:root {
  --portal-bg: #f6f8fb;
  --portal-bg-soft: #eef4f7;
  --portal-surface: #ffffff;
  --portal-surface-soft: #f9fbfd;
  --portal-ink: #15202b;
  --portal-text: #243241;
  --portal-muted: #64748b;
  --portal-primary: #245bff;
  --portal-primary-dark: #173c9f;
  --portal-secondary: #0f9f8f;
  --portal-accent: #f2a51a;
  --portal-pink: #de3c7b;
  --portal-line: #dce5ee;
  --portal-line-strong: #b8c7d8;
  --portal-white: #ffffff;
  --portal-radius: 8px;
  --portal-shadow: 0 18px 48px rgba(21, 32, 43, 0.08);
  --portal-shadow-hover: 0 24px 64px rgba(21, 32, 43, 0.12);
  --portal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --portal-font: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Backward-compatible aliases used by the existing theme. */
  --brand: var(--portal-primary);
  --brand-dark: var(--portal-primary-dark);
  --accent: var(--portal-secondary);
  --text: var(--portal-text);
  --muted: var(--portal-muted);
  --border: var(--portal-line);
  --bg: var(--portal-bg);
  --white: var(--portal-white);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  padding-left: 88px;
  color: var(--portal-text);
  font-family: var(--portal-font);
  font-feature-settings: "palt" 1;
  background-color: var(--portal-bg);
  background-image:
    linear-gradient(90deg, rgba(36, 91, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 159, 143, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #f8fafc 0%, #eef5f8 46%, #ffffff 100%);
  background-size: 56px 56px, 56px 56px, 100% 100%;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--portal-primary);
  text-underline-offset: 0.16em;
}

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

/* Fixed portal rail */
.site-header {
  position: fixed;
  z-index: 1000;
  inset: 0 auto 0 0;
  width: 88px;
  height: 100vh;
  padding: 0;
  color: var(--portal-ink);
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-right: 1px solid rgba(184, 199, 216, 0.72);
  box-shadow: 10px 0 34px rgba(21, 32, 43, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.admin-bar .site-header {
  top: 32px;
  height: calc(100vh - 32px);
}

.site-header .site-container {
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 20px 0 24px;
}

.site-logo {
  margin: 0;
}

.site-logo a {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  text-decoration: none;
  background: linear-gradient(145deg, var(--portal-primary), var(--portal-secondary));
  border-radius: var(--portal-radius);
  box-shadow: 0 10px 26px rgba(36, 91, 255, 0.24);
}

.site-logo a::after {
  content: "AI";
  color: var(--portal-white);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.site-logo-text {
  font-size: 0;
}

.site-nav,
.header-search {
  display: none !important;
}

.hamburger-btn {
  position: relative;
  display: grid !important;
  width: 48px;
  height: 112px;
  padding: 14px 0 52px;
  place-items: center;
  color: var(--portal-ink);
  background: transparent;
  border: 0;
  border-radius: var(--portal-radius);
  cursor: pointer;
  transition: background 220ms var(--portal-ease), color 220ms var(--portal-ease);
}

.hamburger-btn:hover {
  color: var(--portal-primary);
  background: var(--portal-bg-soft);
}

.hamburger-btn::after {
  content: "MENU";
  position: absolute;
  bottom: 10px;
  left: 50%;
  color: currentColor;
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;
  writing-mode: vertical-rl;
  transform: translateX(-50%);
}

.hamburger-btn span {
  width: 22px;
  height: 2px;
  margin: 2px 0;
  background: currentColor;
  border-radius: 999px;
}

/* Navigation drawer */
.mobile-nav-overlay {
  position: fixed;
  z-index: 990;
  top: 0;
  bottom: 0;
  left: 88px;
  display: block;
  width: min(420px, calc(100vw - 88px));
  height: 100vh;
  padding: 76px 42px 42px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid var(--portal-line);
  box-shadow: 24px 0 64px rgba(21, 32, 43, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-110%);
  transition: transform 380ms var(--portal-ease), opacity 260ms ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

body.admin-bar .mobile-nav-overlay {
  top: 32px;
  height: calc(100vh - 32px);
}

.mobile-nav-overlay ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-nav-overlay li {
  margin: 0;
  border-bottom: 1px solid var(--portal-line);
}

.mobile-nav-overlay a {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  color: var(--portal-ink);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-nav-overlay a:hover {
  color: var(--portal-primary);
}

.mobile-nav-overlay li a {
  display: flex;
  min-height: 56px;
  align-items: center;
  padding: 13px 4px;
  color: var(--portal-ink);
  font-size: 1rem;
  border-bottom: 0;
}

.mobile-search {
  margin-bottom: 22px;
}

.mobile-search form {
  display: flex;
}

.mobile-search input {
  min-width: 0;
  padding: 12px 14px;
  color: var(--portal-ink);
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-line);
  border-right: 0;
  border-radius: var(--portal-radius) 0 0 var(--portal-radius);
}

.mobile-search button {
  padding: 12px 15px;
  color: var(--portal-white);
  background: var(--portal-secondary);
  border: 1px solid var(--portal-secondary);
  border-radius: 0 var(--portal-radius) var(--portal-radius) 0;
}

.mobile-nav-overlay a img,
.mobile-nav-overlay .cat-icon {
  display: none !important;
}

/* Shared frame */
.breadcrumb {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 40px 0;
  color: var(--portal-muted);
  font-size: 0.78rem;
  background: transparent;
  border: 0;
}

.breadcrumb a {
  color: var(--portal-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--portal-primary);
}

.breadcrumb img,
.breadcrumb .emoji {
  display: none !important;
}

.content-wrap {
  display: block;
  width: min(100%, 1100px);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px 96px;
}

.main-content {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sidebar {
  display: none !important;
}

.post-header {
  position: relative;
  padding: clamp(42px, 7vw, 88px) 0 clamp(30px, 5vw, 56px);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.post-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.post-cat-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  color: var(--portal-primary-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: rgba(36, 91, 255, 0.08);
  border: 1px solid rgba(36, 91, 255, 0.16);
  border-radius: 999px;
}

.post-cat-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-secondary));
  border-radius: 50%;
}

.post-cat-badge img,
.post-cat-badge .emoji {
  display: none !important;
}

.post-title {
  max-width: 980px;
  margin: 0;
  color: var(--portal-ink);
  font-size: clamp(2.25rem, 5.2vw, 4.35rem);
  font-weight: 900;
  line-height: 1.13;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 26px;
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.post-meta img,
.post-meta .emoji {
  display: none !important;
}

/* Featured image wrapper immediately following the post header. */
.post-header + div {
  overflow: hidden;
  margin: 0 0 34px !important;
  background: var(--portal-surface);
  border: 1px solid var(--portal-line) !important;
  border-radius: var(--portal-radius) !important;
  box-shadow: var(--portal-shadow) !important;
}

.post-header + div img {
  display: block;
  width: 100%;
  height: auto;
}

.post-content {
  padding: clamp(30px, 5.7vw, 64px);
  color: var(--portal-text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--portal-line);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
}

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

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

.post-content p,
.post-content li {
  font-size: clamp(1rem, 1.35vw, 1.075rem);
  line-height: 1.95;
}

.post-content p {
  margin: 0 0 1.75em;
}

.post-content > p:first-of-type {
  color: var(--portal-ink);
  font-size: clamp(1.07rem, 1.65vw, 1.17rem);
  font-weight: 600;
}

.post-content h2 {
  position: relative;
  margin: 3.1em 0 1.1em;
  padding: 0 0 0.58em;
  color: var(--portal-ink);
  font-size: clamp(1.7rem, 3.1vw, 2.25rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.025em;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
}

.post-content h2::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 84px;
  height: 3px;
  background: linear-gradient(90deg, var(--portal-primary), var(--portal-secondary));
  border-radius: 999px;
}

.post-content h3 {
  margin: 2.4em 0 0.9em;
  padding-left: 0.85em;
  color: var(--portal-ink);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.45;
  border-left: 4px solid var(--portal-secondary);
}

.post-content h4 {
  margin: 2em 0 0.8em;
  color: var(--portal-ink);
  font-size: 1.1rem;
  font-weight: 800;
}

.post-content ul,
.post-content ol {
  margin: 1.5em 0 2em;
  padding: 20px 24px 20px 48px;
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-line);
  border-radius: var(--portal-radius);
}

.post-content li + li {
  margin-top: 0.45em;
}

.post-content blockquote {
  margin: 2.2em 0;
  padding: 22px 24px;
  color: var(--portal-text);
  background: rgba(15, 159, 143, 0.07);
  border: 0;
  border-left: 4px solid var(--portal-secondary);
  border-radius: 0 var(--portal-radius) var(--portal-radius) 0;
}

.post-content figure,
.post-content img {
  max-width: 100%;
  height: auto;
}

.post-content figure {
  margin: 2.4em auto;
}

.post-content img {
  border-radius: var(--portal-radius);
}

.post-content figcaption {
  margin-top: 0.65em;
  color: var(--portal-muted);
  font-size: 0.78rem;
  text-align: center;
}

.post-content table {
  width: 100%;
  margin: 2em 0;
  border-collapse: collapse;
  background: var(--portal-surface);
  border: 1px solid var(--portal-line);
}

.post-content th,
.post-content td {
  padding: 13px 14px;
  border: 1px solid var(--portal-line);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  color: var(--portal-ink);
  background: var(--portal-bg-soft);
  font-weight: 800;
}

.post-content pre,
.post-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.post-content pre {
  max-width: 100%;
  padding: 20px;
  overflow-x: auto;
  color: #e8eef5;
  background: var(--portal-ink);
  border-radius: var(--portal-radius);
}

/* Affiliate / CTA blocks */
.amazon-box {
  margin: 3em 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: linear-gradient(145deg, #132338 0%, #173c9f 100%) !important;
  border: 0 !important;
  border-radius: var(--portal-radius) !important;
  box-shadow: 0 22px 54px rgba(21, 32, 43, 0.18) !important;
}

.amazon-box-inner {
  padding: clamp(24px, 4vw, 38px) !important;
}

.amazon-box,
.amazon-box p,
.amazon-box a:not(.btn-amazon) {
  color: var(--portal-white);
}

.amazon-box-label {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 5px 10px;
  color: var(--portal-white) !important;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.13) !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.btn-amazon {
  display: inline-flex !important;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 13px 22px !important;
  color: #3c2a00 !important;
  font-weight: 900 !important;
  text-decoration: none !important;
  background: var(--portal-accent) !important;
  border: 0 !important;
  border-radius: var(--portal-radius) !important;
  box-shadow: 0 12px 28px rgba(242, 165, 26, 0.25);
  transition: transform 220ms var(--portal-ease), box-shadow 220ms var(--portal-ease) !important;
}

.btn-amazon:hover {
  color: #271b00 !important;
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(242, 165, 26, 0.32);
}

/* Archives and generic cards */
.archive-header,
.page-header {
  padding: clamp(42px, 7vw, 76px) 0 30px;
  color: var(--portal-ink);
  background: transparent;
  border: 0;
}

.archive-title,
.page-title {
  margin: 0;
  color: var(--portal-ink);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.post-card,
.article-card,
.archive .main-content article,
.blog .main-content article,
.search .main-content article {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--portal-line);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
  transition: transform 260ms var(--portal-ease), box-shadow 260ms var(--portal-ease);
}

.post-card:hover,
.article-card:hover,
.archive .main-content article:hover,
.blog .main-content article:hover,
.search .main-content article:hover {
  transform: translateY(-3px);
  box-shadow: var(--portal-shadow-hover);
}

/* Footer */
.site-footer {
  margin: 0;
  padding: 58px 40px 36px;
  color: rgba(255, 255, 255, 0.72);
  background: var(--portal-ink);
  border: 0;
}

.site-footer .site-container {
  width: min(100%, 1020px);
  max-width: 1020px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--portal-white);
}

.site-footer a:hover {
  color: #a9e4dc;
}

@media (max-width: 900px) {
  .mobile-nav-overlay.open,
  body.admin-bar .mobile-nav-overlay.open {
    color: var(--portal-white) !important;
    background: var(--portal-ink) !important;
  }

  .mobile-nav-overlay.open li a,
  body.admin-bar .mobile-nav-overlay.open li a {
    color: var(--portal-white) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  .mobile-nav-overlay.open li a:hover {
    color: #a9e4dc !important;
  }

  .site-header,
  body.admin-bar .site-header {
    overflow: visible !important;
  }

  .mobile-nav-overlay,
  body.admin-bar .mobile-nav-overlay {
    position: absolute !important;
    top: 72px !important;
    right: auto !important;
    bottom: auto !important;
    left: 0 !important;
    display: block !important;
    width: 100vw !important;
    height: calc(100vh - 72px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-12px) !important;
  }

  body.admin-bar .mobile-nav-overlay {
    height: calc(100vh - 118px) !important;
  }

  .mobile-nav-overlay.open,
  body.admin-bar .mobile-nav-overlay.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  body {
    padding-top: 72px;
    padding-left: 0;
    background-size: 40px 40px, 40px 40px, 100% 100%;
  }

  body.admin-bar {
    padding-top: 118px;
  }

  .site-header,
  body.admin-bar .site-header {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: 72px;
    border: 0;
    border-bottom: 1px solid rgba(184, 199, 216, 0.72);
    box-shadow: 0 10px 34px rgba(21, 32, 43, 0.06);
  }

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

  .header-inner {
    flex-direction: row;
    padding: 0 20px;
  }

  .site-logo a {
    width: 42px;
    height: 42px;
  }

  .hamburger-btn {
    width: 46px;
    height: 46px;
    padding: 11px;
  }

  .hamburger-btn::after {
    display: none;
  }

  .mobile-nav-overlay,
  body.admin-bar .mobile-nav-overlay {
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100vh - 72px);
    padding: 28px 24px 40px;
    border: 0;
    transform: translateY(-16px);
  }

  body.admin-bar .mobile-nav-overlay {
    top: 118px;
    height: calc(100vh - 118px);
  }

  .mobile-nav-overlay.open {
    transform: translateY(0);
  }

  .breadcrumb {
    padding: 18px 20px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .content-wrap {
    padding: 0 20px 64px;
  }

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

  .post-title {
    font-size: clamp(2rem, 9.5vw, 3.25rem);
    line-height: 1.16;
  }

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

  .post-header + div {
    margin-bottom: 20px !important;
  }

  .post-content {
    padding: 28px 22px;
  }

  .post-content h2 {
    margin-top: 2.6em;
  }

  .post-content ul,
  .post-content ol {
    padding: 18px 18px 18px 40px;
  }

  .post-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .site-footer {
    padding: 44px 20px 30px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 900px) {
  .mobile-nav-overlay,
  body.admin-bar .mobile-nav-overlay {
    position: fixed !important;
    inset: 72px 0 0 0 !important;
    display: none !important;
    width: auto !important;
    height: auto !important;
    padding: 28px 24px 40px !important;
    overflow-y: auto !important;
    color: var(--portal-white) !important;
    background: var(--portal-ink) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    pointer-events: auto !important;
    z-index: 2147483646 !important;
  }

  body.admin-bar .mobile-nav-overlay {
    inset: 118px 0 0 0 !important;
  }

  .mobile-nav-overlay.open,
  body.admin-bar .mobile-nav-overlay.open {
    display: block !important;
  }
}

/* WordPress single-post title: keep Japanese phrases together */
body.single-post .post-title {
  word-break: normal;
  word-break: auto-phrase;
  line-break: strict;
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* WordPress category archive refinement: compact hero and polished dates */
body.category .cat-page-banner {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 28px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(115deg, #173c9f 0%, #245bff 64%, #137f91 135%);
  box-shadow: inset 0 -1px 0 rgba(6, 24, 75, 0.12);
}
body.category .cat-page-banner .site-container {
  position: relative;
  z-index: 1;
  min-height: 0;
  height: auto;
  padding: 0 40px;
  text-align: left;
}
body.category .cat-page-banner .site-container > img.emoji {
  display: none !important;
}
body.category .cat-page-banner .site-container::before {
  content: "CATEGORY";
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(5, 29, 93, 0.12);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
  backdrop-filter: blur(8px);
}
body.category-ai-news .cat-page-banner .site-container::before {
  content: "AI JOURNAL";
}
body.category .cat-page-banner .site-container::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 48px;
  width: 116px;
  height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 32px;
  transform: translateY(-50%) rotate(12deg);
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.035);
}
body.category .cat-page-banner h1 {
  margin: 10px 0 3px;
  color: #fff;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
body.category .cat-page-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
body.category .post-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 28px;
  margin-top: auto;
  padding: 6px 10px;
  border: 1px solid rgba(36, 91, 255, 0.14);
  border-radius: 999px;
  color: #58708f;
  background: rgba(36, 91, 255, 0.055);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.015em;
}
body.category .post-card-meta img.emoji {
  display: none !important;
}
body.category .post-card-meta::before {
  content: "";
  box-sizing: border-box;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 1.5px solid #245bff;
  border-radius: 3px;
  background:
    linear-gradient(#245bff, #245bff) 1px 3px / 9px 1px no-repeat,
    linear-gradient(#245bff, #245bff) 3px 0 / 1.5px 4px no-repeat,
    linear-gradient(#245bff, #245bff) 8px 0 / 1.5px 4px no-repeat;
}
@media (max-width: 700px) {
  body.category .cat-page-banner {
    padding: 22px 0;
  }
  body.category .cat-page-banner .site-container {
    padding: 0 22px;
  }
  body.category .cat-page-banner .site-container::after {
    right: -34px;
    width: 96px;
    height: 96px;
    opacity: 0.8;
  }
  body.category .cat-page-banner h1 {
    margin-top: 8px;
    font-size: 30px;
  }
  body.category .cat-page-banner p {
    font-size: 13px;
  }
  body.category .post-card-meta {
    min-height: 26px;
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* Hide the legacy category emoji wrapper after the compact hero redesign */
body.category .cat-page-banner .cat-page-banner-icon {
  display: none !important;
}

/* Category directory page */
.category-hub {
  min-height: 70vh;
}

.category-hub-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.18), transparent 27%),
    radial-gradient(circle at 18% 120%, rgba(18, 188, 180, 0.2), transparent 34%),
    linear-gradient(118deg, #112f82 0%, #245bff 58%, #137f91 135%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.category-hub-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -155px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 46px rgba(255, 255, 255, 0.028),
    0 0 0 92px rgba(255, 255, 255, 0.018);
}

.category-hub-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 56px;
  min-height: 264px;
  padding: 48px 40px;
}

.category-hub-eyebrow,
.category-hub-section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
}

.category-hub-eyebrow {
  min-height: 29px;
  padding: 7px 12px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(4, 24, 79, 0.14);
  backdrop-filter: blur(8px);
}

.category-hub-hero h1 {
  max-width: 760px;
  margin: 15px 0 10px;
  color: #fff;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.category-hub-hero__copy > p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.8;
}

.category-hub-hero__visual {
  display: grid;
  grid-template-columns: repeat(2, 74px);
  gap: 10px;
  transform: rotate(5deg);
}

.category-hub-hero__visual span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.095);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  box-shadow: 0 16px 38px rgba(3, 27, 87, 0.14);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  backdrop-filter: blur(10px);
}

.category-hub-hero__visual span:nth-child(2),
.category-hub-hero__visual span:nth-child(3) {
  background: rgba(255, 255, 255, 0.15);
}

.category-hub-directory {
  padding: 58px 0 88px;
}

.category-hub-directory > .site-container {
  padding-inline: 40px;
}

.category-hub-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 450px);
  align-items: end;
  gap: 48px;
  margin-bottom: 30px;
}

.category-hub-section-kicker {
  margin-bottom: 10px;
  color: #245bff;
}

.category-hub-section-head h2 {
  margin: 0;
  color: #111b2a;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.category-hub-section-head p {
  margin: 0;
  color: #65748a;
  font-size: 14px;
  line-height: 1.85;
}

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

.category-hub-card {
  --hub-accent: #245bff;
  --hub-soft: rgba(36, 91, 255, 0.09);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 292px;
  padding: 30px;
  overflow: hidden;
  color: #111b2a;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 42, 89, 0.1);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(18, 48, 98, 0.075);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.category-hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30px;
  width: 72px;
  height: 4px;
  background: var(--hub-accent);
  border-radius: 0 0 8px 8px;
}

.category-hub-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -92px;
  right: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--hub-soft), transparent 68%);
  pointer-events: none;
}

.category-hub-card--gadget {
  --hub-accent: #087f8c;
  --hub-soft: rgba(8, 127, 140, 0.1);
}

.category-hub-card--beauty {
  --hub-accent: #d65c79;
  --hub-soft: rgba(214, 92, 121, 0.105);
}

.category-hub-card--lifestyle {
  --hub-accent: #cf8b19;
  --hub-soft: rgba(207, 139, 25, 0.11);
}

.category-hub-card:hover,
.category-hub-card:focus-visible {
  color: #111b2a;
  border-color: color-mix(in srgb, var(--hub-accent) 34%, transparent);
  box-shadow: 0 24px 58px rgba(18, 48, 98, 0.13);
  transform: translateY(-4px);
}

.category-hub-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hub-accent) 30%, transparent);
  outline-offset: 3px;
}

.category-hub-card__number {
  position: absolute;
  top: 24px;
  right: 27px;
  color: rgba(17, 43, 80, 0.18);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.category-hub-card__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  color: var(--hub-accent);
  background: var(--hub-soft);
  border: 1px solid color-mix(in srgb, var(--hub-accent) 14%, transparent);
  border-radius: 17px;
}

.category-hub-card__icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-hub-card--ai .category-hub-card__icon svg {
  fill: currentColor;
  stroke: none;
}

.category-hub-card__eyebrow {
  margin-bottom: 7px;
  color: var(--hub-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.category-hub-card__title {
  color: #111b2a;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.category-hub-card__description {
  max-width: 480px;
  margin-top: 10px;
  color: #65748a;
  font-size: 13px;
  line-height: 1.75;
}

.category-hub-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
}

.category-hub-card__count {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 6px 10px;
  color: #68798f;
  background: #f5f8fc;
  border: 1px solid #e5ebf3;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.category-hub-card__link {
  color: var(--hub-accent);
  font-size: 12px;
  font-weight: 800;
}

.category-hub-card__link span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 180ms ease;
}

.category-hub-card:hover .category-hub-card__link span {
  transform: translateX(4px);
}

@media (max-width: 800px) {
  .category-hub-hero__inner {
    min-height: 224px;
    padding: 38px 26px;
  }

  .category-hub-hero__visual {
    grid-template-columns: repeat(2, 58px);
  }

  .category-hub-hero h1 {
    font-size: 40px;
  }

  .category-hub-directory > .site-container {
    padding-inline: 26px;
  }

  .category-hub-section-head {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .category-hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .category-hub-hero__inner {
    grid-template-columns: 1fr;
    min-height: 218px;
    padding: 32px 22px;
  }

  .category-hub-hero__visual {
    display: none;
  }

  .category-hub-hero h1 {
    margin-top: 12px;
    font-size: 34px;
  }

  .category-hub-hero__copy > p {
    font-size: 13px;
    line-height: 1.7;
  }

  .category-hub-directory {
    padding: 42px 0 64px;
  }

  .category-hub-directory > .site-container {
    padding-inline: 22px;
  }

  .category-hub-section-head {
    margin-bottom: 22px;
  }

  .category-hub-section-head h2 {
    font-size: 28px;
  }

  .category-hub-card {
    min-height: 272px;
    padding: 25px;
    border-radius: 20px;
  }

  .category-hub-card::before {
    left: 25px;
  }

  .category-hub-card__number {
    top: 21px;
    right: 22px;
  }

  .category-hub-card__icon {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    border-radius: 15px;
  }

  .category-hub-card__title {
    font-size: 23px;
  }
}

/* Category directory cards with latest-post imagery */
.category-hub-card {
  min-height: 520px;
}

.category-hub-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  margin: -30px -30px 25px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.5), transparent 24%),
    linear-gradient(135deg, var(--hub-soft), #edf4ff);
  border-bottom: 1px solid rgba(17, 42, 89, 0.08);
}

.category-hub-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 24, 51, 0.08), transparent 32%);
  pointer-events: none;
}

.category-hub-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.category-hub-card:hover .category-hub-card__media img,
.category-hub-card:focus-visible .category-hub-card__media img {
  transform: scale(1.035);
}

.category-hub-card__media.is-fallback::before {
  content: "CATEGORY";
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--hub-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  transform: translate(-50%, -50%);
}

.category-hub-card__number {
  top: 16px;
  right: 18px;
  min-width: 33px;
  padding: 7px 9px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  background: rgba(10, 28, 62, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(7, 23, 55, 0.12);
  line-height: 1;
  backdrop-filter: blur(8px);
}

.category-hub-card__icon {
  margin-bottom: 18px;
}

@media (max-width: 560px) {
  .category-hub-card {
    min-height: 470px;
  }

  .category-hub-card__media {
    margin: -25px -25px 22px;
  }

  .category-hub-card__number {
    top: 14px;
    right: 16px;
  }
}

/* Double the spacing between category banner and post cards */
body.category .cat-page-banner {
  margin-bottom: 16px;
}