/*
Theme Name: Company Analytics
Theme URI: https://company-analytics.app.babl.tech/
Author: BablApp
Description: A focused editorial theme for company analysis notes, financial context, and business model comparisons.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: company-analytics
*/

:root {
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-alt: #e9f1ef;
  --ink: #13202b;
  --muted: #66717f;
  --line: #d9ddd7;
  --accent: #0e6f68;
  --accent-strong: #0b4d62;
  --accent-soft: #d9ebe8;
  --gold: #b8872f;
  --red: #b9493f;
  --shadow: 0 16px 40px rgba(19, 32, 43, 0.08);
  --radius: 8px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0;
}

a {
  color: var(--accent-strong);
  text-decoration-color: rgba(14, 111, 104, 0.35);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  left: 16px;
  position: absolute;
  top: -48px;
  z-index: 10;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.header-inner,
.site-main,
.site-footer-inner {
  margin: 0 auto;
  max-width: var(--max);
  padding-left: 24px;
  padding-right: 24px;
}

.header-inner {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 72px;
}

.site-branding {
  display: grid;
  gap: 2px;
}

.site-title {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.site-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.primary-menu {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-menu a {
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 10px 12px;
  text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.site-main {
  padding-bottom: 72px;
  padding-top: 42px;
}

.home-hero {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  min-height: 360px;
  padding: 36px 0 44px;
}

.home-hero h1,
.archive-title,
.entry-title {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0;
}

.home-hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  max-width: 820px;
}

.home-hero p {
  color: var(--muted);
  font-size: 18px;
  margin: 18px 0 0;
  max-width: 700px;
}

.hero-panel {
  align-self: stretch;
  background:
    linear-gradient(135deg, rgba(14, 111, 104, 0.95), rgba(11, 77, 98, 0.95)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: #fff;
  display: grid;
  gap: 16px;
  padding: 28px;
}

.hero-panel strong {
  display: block;
  font-size: 14px;
  opacity: 0.78;
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric-row {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding-bottom: 12px;
}

.metric-row span {
  color: rgba(255, 255, 255, 0.74);
}

.metric-row b {
  font-size: 26px;
  line-height: 1;
}

.section-title {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 18px 0 20px;
  padding-top: 22px;
}

.section-title h2 {
  font-size: 20px;
  margin: 0;
}

.post-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(19, 32, 43, 0.05);
  display: grid;
  gap: 14px;
  min-height: 250px;
  padding: 22px;
}

.post-card h2,
.post-card h3 {
  font-size: 21px;
  line-height: 1.35;
  margin: 0;
}

.post-card p {
  color: var(--muted);
  margin: 0;
}

.eyebrow,
.entry-meta,
.tag-list,
.cat-links {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cat-links,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-links a,
.tag-list a,
.pill {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  line-height: 1;
  padding: 7px 10px;
  text-decoration: none;
}

.entry-shell {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 760px) minmax(260px, 1fr);
}

.entry-shell > * {
  min-width: 0;
}

.entry-header,
.entry-content,
.entry-footer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(19, 32, 43, 0.05);
  padding: 30px;
}

.entry-title {
  font-size: clamp(34px, 5vw, 56px);
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.entry-summary {
  color: var(--muted);
  font-size: 18px;
  margin: 18px 0 0;
}

.entry-content h2,
.entry-content h3 {
  line-height: 1.35;
  margin: 34px 0 12px;
}

.entry-content h2 {
  border-left: 5px solid var(--accent);
  font-size: 26px;
  padding-left: 14px;
}

.entry-content h3 {
  font-size: 21px;
}

.entry-content p {
  margin: 0 0 18px;
  overflow-wrap: break-word;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.35em;
}

.entry-content li + li {
  margin-top: 8px;
}

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

.entry-content th,
.entry-content td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.entry-content th {
  background: var(--surface-alt);
}

.wp-block-quote,
.insight-box {
  background: var(--surface-alt);
  border-left: 5px solid var(--gold);
  margin: 26px 0;
  padding: 18px 20px;
}

.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.analysis-map {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0;
  padding: 16px;
}

.analysis-node {
  border-top: 5px solid var(--accent);
  min-height: 126px;
  padding: 12px;
}

.analysis-node:nth-child(2) {
  border-top-color: var(--gold);
}

.analysis-node:nth-child(3) {
  border-top-color: var(--red);
}

.analysis-node b {
  display: block;
  margin-bottom: 6px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 96px;
}

.sidebar-card h2,
.sidebar-card h3 {
  font-size: 18px;
  margin: 0 0 12px;
}

.sidebar-card ul {
  margin: 0;
  padding-left: 18px;
}

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.76);
  padding: 34px 0;
}

.site-footer a {
  color: #fff;
}

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

@media (max-width: 900px) {
  .header-inner,
  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-hero,
  .entry-shell,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .entry-shell {
    gap: 20px;
  }

  .sidebar-card {
    position: static;
  }

  .kpi-grid,
  .analysis-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
    line-height: 1.78;
  }

  .header-inner,
  .site-main,
  .site-footer-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-main {
    padding-bottom: 48px;
    padding-top: 24px;
  }

  .header-inner {
    gap: 12px;
    min-height: 0;
    padding-bottom: 14px;
    padding-top: 14px;
  }

  .site-branding {
    width: 100%;
  }

  .site-title {
    font-size: 18px;
  }

  .site-navigation {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .primary-menu {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: max-content;
  }

  .primary-menu a {
    min-height: 38px;
    white-space: nowrap;
  }

  .entry-header,
  .entry-content,
  .entry-footer,
  .post-card,
  .hero-panel {
    padding: 18px;
  }

  .entry-title {
    font-size: clamp(28px, 10vw, 38px);
    line-height: 1.16;
  }

  .entry-summary,
  .home-hero p {
    font-size: 16px;
  }

  .entry-content h2 {
    font-size: 22px;
    margin-top: 30px;
    padding-left: 12px;
  }

  .entry-content h3 {
    font-size: 18px;
  }

  .entry-content ul,
  .entry-content ol {
    padding-left: 1.15em;
  }

  .entry-content table {
    display: block;
    font-size: 14px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .entry-content th,
  .entry-content td {
    min-width: 132px;
    padding: 10px;
  }

  .entry-content th:first-child,
  .entry-content td:first-child {
    min-width: 116px;
  }

  .kpi-grid,
  .analysis-map {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-card strong {
    font-size: 22px;
  }

  .wp-block-quote,
  .insight-box {
    margin: 22px 0;
    padding: 16px;
  }
}

@media (max-width: 380px) {
  .header-inner,
  .site-main,
  .site-footer-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .entry-header,
  .entry-content,
  .entry-footer,
  .post-card,
  .hero-panel {
    padding: 16px;
  }

  .cat-links a,
  .tag-list a,
  .pill {
    padding: 7px 9px;
  }
}
