/* =============================================================
   Otona Match Navi v2 — Cocoon Integration & Defensive Reset
   Loaded AFTER all other v2 CSS to override Cocoon parent leaks.
   ============================================================= */

/* Body reset */
body.om-body {
  background: var(--om-cream);
  margin: 0;
  padding: 0;
  font-family: var(--om-font-sans);
  color: var(--om-ink);
}

/* Our main wrapper (opened in header.php) */
#om-main {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  min-height: calc(100vh - 400px);
}

/* Hide any Cocoon residual wrappers that might slip through */
body.om-body #container,
body.om-body .wrapper,
body.om-body > .header-container,
body.om-body > #header-container,
body.om-body > .navi-container,
body.om-body > .footer-container,
body.om-body .appeal,
body.om-body .pan-list-container,
body.om-body .breadcrumb.pankuzu {
  display: none !important;
}

/* Hide Cocoon's own breadcrumb if duplicated */
body.single.om-body .breadcrumb:not(.om-breadcrumb) {
  display: none !important;
}

/* Ensure section-level elements are full-width */
.om-hero,
.om-dark,
.om-hub,
.om-closer,
.om-section,
.om-related,
.om-site-footer {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Admin bar offset */
body.admin-bar.om-body .om-site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar.om-body .om-site-header { top: 46px; }
}

/* Global Nav link styling override */
.om-site-header .om-global-nav {
  display: flex;
  gap: 28px;
  font-family: var(--om-font-sans);
  font-size: var(--om-fs-label);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.om-site-header .om-global-nav a {
  color: var(--om-ink);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.om-site-header .om-global-nav a:hover {
  color: var(--om-burgundy);
  border-bottom-color: var(--om-burgundy);
}

/* ==============================================
   ARTICLE PAGE integration CSS (single.php)
   ============================================== */

.om-breadcrumb {
  max-width: var(--om-max-content);
  margin: 0 auto;
  padding: 20px var(--om-side-padding) 0;
  font-family: var(--om-font-sans);
  font-size: 10px;
  letter-spacing: var(--om-track-mid);
  text-transform: uppercase;
  color: var(--om-ink-soft);
}
.om-breadcrumb a { color: var(--om-ink-soft); text-decoration: none; }
.om-breadcrumb .om-sep { margin: 0 8px; color: var(--om-rule); }
.om-breadcrumb .om-current { color: var(--om-burgundy); }

.om-article-head {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px var(--om-side-padding) 32px;
}
.om-article-head .om-meta-top {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--om-font-sans);
  font-size: 10px;
  letter-spacing: var(--om-track-wide);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.om-article-head .om-meta-top .om-cat { color: var(--om-burgundy); font-weight: 700; }
.om-article-head .om-meta-top .om-sep { color: var(--om-rule); }
.om-article-head .om-meta-top .om-date,
.om-article-head .om-meta-top .om-reading { color: var(--om-ink-mid); }

.om-article-head .om-article-h1 {
  font-family: var(--om-font-serif-display);
  font-size: 52px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 0 0 20px;
  color: var(--om-ink);
}
.om-article-head .om-article-h1 em { font-style: italic; color: var(--om-burgundy); }

.om-article-head .om-deck {
  font-family: var(--om-font-serif-body);
  font-size: 20px;
  font-style: italic;
  line-height: 1.6;
  color: var(--om-ink-mid);
  margin: 0 0 28px;
  max-width: 94%;
}

.om-article-head .om-rule-thick {
  height: 2px;
  background: var(--om-ink);
  margin-bottom: 20px;
}

.om-article-head .om-byline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--om-font-sans);
  font-size: 11px;
  color: var(--om-ink-mid);
  letter-spacing: 1px;
}
.om-article-head .om-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.om-article-head .om-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--om-cream-paper), var(--om-bronze));
  display: flex;
  align-items: center;
  justify-content: center;
}
.om-article-head .om-monogram {
  font-family: var(--om-font-serif-display);
  font-style: italic;
  font-size: 12px;
  color: var(--om-dark-base);
  font-weight: 600;
}
.om-article-head .om-author b {
  font-weight: 600;
  color: var(--om-ink);
  font-family: var(--om-font-serif-display);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0;
}
.om-article-head .om-tools {
  display: flex;
  gap: 20px;
  font-size: 10px;
  letter-spacing: var(--om-track-mid);
  text-transform: uppercase;
}

.om-hero-image {
  max-width: var(--om-max-content);
  margin: 0 auto;
  padding: 0 var(--om-side-padding);
}
.om-hero-image img,
.om-hero-image .om-ph {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, #4a2028 0%, var(--om-burgundy) 40%, var(--om-bronze) 100%);
  border-radius: 2px;
}
.om-hero-image .om-caption {
  font-family: var(--om-font-sans);
  font-size: 11px;
  color: var(--om-ink-soft);
  margin-top: 10px;
}

.om-article-body-wrap {
  max-width: var(--om-max-content);
  margin: 0 auto;
  padding: 60px var(--om-side-padding) 80px;
  display: grid;
  grid-template-columns: 720px 1fr;
  gap: 60px;
}
.om-article-main { min-width: 0; }
.om-article-main p {
  font-family: var(--om-font-serif-body);
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--om-ink);
  margin: 0 0 22px;
}
.om-article-main h2 {
  font-family: var(--om-font-serif-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  margin: 64px 0 14px;
  letter-spacing: -0.3px;
  position: relative;
  padding-top: 24px;
  color: var(--om-ink);
}
.om-article-main h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--om-burgundy);
}
.om-article-main h2 em { font-style: italic; color: var(--om-burgundy); }
.om-article-main h3 {
  font-family: var(--om-font-serif-display);
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 12px;
  color: var(--om-ink);
}
.om-article-main h4 {
  font-family: var(--om-font-serif-body);
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 10px;
  color: var(--om-ink);
}
.om-article-main a {
  color: var(--om-burgundy);
  text-decoration: none;
  border-bottom: 1px solid var(--om-bronze);
  padding-bottom: 1px;
}
.om-article-main a:hover {
  color: var(--om-burgundy);
  border-bottom-color: var(--om-burgundy);
}
.om-article-main ul,
.om-article-main ol {
  font-family: var(--om-font-serif-body);
  font-size: 16px;
  line-height: 1.95;
  color: var(--om-ink);
  padding-left: 22px;
  margin: 0 0 22px;
}
.om-article-main li { margin-bottom: 6px; }
.om-article-main strong,
.om-article-main b {
  font-weight: 600;
  background: linear-gradient(transparent 62%, rgba(184,147,90,0.28) 62%);
  padding: 0 2px;
}
.om-article-main p.om-lede { font-size: 18px; }
.om-article-main p.om-lede::first-letter {
  font-family: var(--om-font-serif-display);
  font-size: 68px;
  line-height: 0.9;
  float: left;
  padding: 8px 12px 0 0;
  color: var(--om-burgundy);
  font-weight: 500;
}

/* Right rail */
.om-article-rail {
  position: sticky;
  top: 80px;
  align-self: start;
}
.om-rail-block { margin-bottom: 44px; }
.om-rail-block .om-label {
  font-family: var(--om-font-sans);
  font-size: 10px;
  letter-spacing: var(--om-track-wide);
  text-transform: uppercase;
  color: var(--om-burgundy);
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--om-ink);
  margin-bottom: 14px;
}
.om-rail-block .om-toc-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--om-rule);
  font-family: var(--om-font-serif-body);
  font-size: 13px;
  line-height: 1.5;
}
.om-rail-block .om-toc-item a {
  color: var(--om-ink);
  text-decoration: none;
  display: flex;
  gap: 10px;
}
.om-rail-block .om-toc-item a .om-n {
  font-family: var(--om-font-serif-display);
  color: var(--om-burgundy);
  font-size: 11px;
  font-weight: 500;
  min-width: 18px;
}
.om-rail-block .om-pop-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--om-rule);
  text-decoration: none;
  color: inherit;
}
.om-rail-block .om-pop-item .om-n {
  font-family: var(--om-font-serif-display);
  font-size: 22px;
  color: var(--om-burgundy);
  line-height: 1;
  font-weight: 500;
}
.om-rail-block .om-pop-item .om-t {
  font-family: var(--om-font-serif-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--om-ink);
}
.om-rail-block .om-nl-box {
  background: var(--om-dark-base);
  color: var(--om-cream);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}
.om-rail-block .om-nl-box::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -25%;
  width: 80%;
  height: 180%;
  background: radial-gradient(circle, rgba(184,147,90,0.18) 0%, transparent 60%);
}
.om-rail-block .om-nl-box .om-t1 {
  font-family: var(--om-font-serif-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  margin: 0 0 8px;
  position: relative;
}
.om-rail-block .om-nl-box .om-t1 em { color: var(--om-bronze); }
.om-rail-block .om-nl-box .om-t2 {
  font-family: var(--om-font-serif-body);
  font-size: 12px;
  line-height: 1.7;
  color: #c8bfa8;
  margin: 0 0 14px;
  position: relative;
}
.om-rail-block .om-nl-box input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(184,147,90,0.4);
  color: var(--om-cream);
  padding: 8px 0;
  font-family: var(--om-font-sans);
  font-size: 12px;
  margin-bottom: 12px;
  position: relative;
  box-sizing: border-box;
}
.om-rail-block .om-nl-box input::placeholder { color: #8a7a5f; }
.om-rail-block .om-nl-box button {
  width: 100%;
  padding: 11px 0;
  font-family: var(--om-font-sans);
  font-size: 10px;
  letter-spacing: var(--om-track-wide);
  text-transform: uppercase;
  font-weight: 700;
  border: none;
  position: relative;
  cursor: pointer;
}

/* Related articles */
.om-related {
  max-width: var(--om-max-content);
  margin: 0 auto;
  padding: 60px var(--om-side-padding) 80px;
}
.om-related-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--om-ink);
  padding-bottom: 12px;
  margin-bottom: 28px;
}
.om-related-head h3 {
  font-family: var(--om-font-serif-display);
  font-size: 26px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.3px;
}
.om-related-head .om-ey {
  font-family: var(--om-font-sans);
  font-size: 10px;
  letter-spacing: var(--om-track-wide);
  text-transform: uppercase;
  color: var(--om-ink-mid);
}
.om-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.om-rel-card { text-decoration: none; color: inherit; display: block; }
.om-rel-card .om-ph {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--om-cream-paper), var(--om-bronze));
  margin-bottom: 12px;
  overflow: hidden;
}
.om-rel-card .om-ph img { width: 100%; height: 100%; object-fit: cover; }
.om-rel-card:nth-child(2) .om-ph { background: linear-gradient(135deg, #d8cfbe, var(--om-burgundy)); }
.om-rel-card:nth-child(3) .om-ph { background: linear-gradient(135deg, #4a2028, var(--om-bronze)); }
.om-rel-card .om-cat {
  font-family: var(--om-font-sans);
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--om-burgundy);
  font-weight: 700;
  margin-bottom: 6px;
}
.om-rel-card h4 {
  font-family: var(--om-font-serif-display);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 6px;
  line-height: 1.35;
}
.om-rel-card .om-date {
  font-family: var(--om-font-sans);
  font-size: 10px;
  color: var(--om-ink-soft);
  letter-spacing: 1.5px;
}

/* ==============================================
   v2.2 — Bug fixes after production verification
   ============================================== */

/* Fix #1: Hide the leftover sticky mobile CTA on desktop */
.om-sticky-cta-mobile {
  display: none !important;
}
@media (max-width: 767px) {
  .om-sticky-cta-mobile {
    display: block !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
  }
}

/* Fix #2: Footer tagline (renamed from .om-tag to avoid collision with badge chip) */
.om-site-footer .om-footer-tagline,
.om-site-footer p.om-footer-tagline {
  background: transparent !important;
  color: #8a7a5f;
  font-family: var(--om-font-serif-body);
  font-size: 12px;
  line-height: 1.8;
  max-width: 320px;
  margin: 0;
  padding: 0;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  display: block;
}

/* Safety: if .om-tag is still in the footer, neutralize its badge styling there */
.om-site-footer .om-tag {
  background: transparent !important;
  color: #8a7a5f !important;
  padding: 0 !important;
  font-family: var(--om-font-serif-body) !important;
  font-size: 12px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  font-weight: 400 !important;
  display: block !important;
  max-width: 320px;
  line-height: 1.8;
}

/* ==============================================
   v2.4 — Latest articles redesign + FAQ Q&A
   ============================================== */

/* Section 10: Latest articles unified grid */
.om-latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}
.om-latest-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}
.om-latest-card:hover { transform: translateY(-4px); }
.om-latest-card .om-latest-ph {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--om-cream-paper), var(--om-bronze));
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}
.om-latest-card:nth-child(3n+2) .om-latest-ph { background: linear-gradient(135deg, #d8cfbe, var(--om-burgundy)); }
.om-latest-card:nth-child(3n) .om-latest-ph { background: linear-gradient(135deg, #4a2028, var(--om-bronze)); }
.om-latest-card .om-latest-ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.om-latest-card:hover .om-latest-ph img { transform: scale(1.05); }
.om-latest-card .om-latest-body { padding: 0 4px; }
.om-latest-card .om-latest-cat {
  font-family: var(--om-font-sans);
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--om-burgundy);
  font-weight: 700;
  margin-bottom: 8px;
}
.om-latest-card .om-latest-title {
  font-family: var(--om-font-serif-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--om-ink);
  margin: 0 0 14px;
  letter-spacing: -0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.om-latest-card:hover .om-latest-title { color: var(--om-burgundy); }
.om-latest-card .om-latest-meta {
  font-family: var(--om-font-sans);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--om-ink-soft);
  padding-top: 12px;
  border-top: 1px solid var(--om-rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.om-latest-card .om-latest-read {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--om-burgundy);
  font-weight: 600;
  text-transform: uppercase;
}

/* Section 11: FAQ — Editorial Q&A */
.om-faq {
  max-width: 860px;
  margin: 0 auto;
}
.om-faq-item {
  border-bottom: 1px solid var(--om-rule);
  padding: 0;
  margin: 0;
}
.om-faq-item:first-of-type {
  border-top: 2px solid var(--om-ink);
}
.om-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 28px 0;
  display: grid;
  grid-template-columns: 64px 1fr 40px;
  gap: 20px;
  align-items: center;
  transition: color 0.2s;
}
.om-faq-item summary::-webkit-details-marker { display: none; }
.om-faq-item summary:hover { color: var(--om-burgundy); }
.om-faq-item .om-faq-q-mark {
  font-family: var(--om-font-serif-display);
  font-size: 28px;
  color: var(--om-burgundy);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.5px;
}
.om-faq-item .om-faq-q-text {
  font-family: var(--om-font-serif-display);
  font-size: 19px;
  line-height: 1.5;
  color: var(--om-ink);
  font-weight: 500;
  letter-spacing: -0.1px;
}
.om-faq-item .om-faq-toggle {
  font-family: var(--om-font-sans);
  font-size: 24px;
  color: var(--om-ink-soft);
  font-weight: 300;
  text-align: center;
  transition: transform 0.3s;
  line-height: 1;
}
.om-faq-item[open] .om-faq-toggle {
  transform: rotate(45deg);
  color: var(--om-burgundy);
}
.om-faq-item .om-faq-answer {
  display: grid;
  grid-template-columns: 64px 1fr 40px;
  gap: 20px;
  padding: 0 0 32px;
  align-items: start;
}
.om-faq-item .om-faq-a-mark {
  font-family: var(--om-font-serif-display);
  font-size: 22px;
  font-style: italic;
  color: var(--om-bronze);
  font-weight: 500;
  line-height: 1.3;
}
.om-faq-item .om-faq-a-text {
  font-family: var(--om-font-serif-body);
  font-size: 15px;
  line-height: 1.95;
  color: var(--om-ink-mid);
  padding: 2px 0 0;
}

/* Responsive latest grid */
@media (max-width: 980px) {
  .om-latest-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .om-latest-grid { grid-template-columns: 1fr; }
  .om-faq-item summary,
  .om-faq-item .om-faq-answer {
    grid-template-columns: 48px 1fr 32px;
    gap: 14px;
  }
  .om-faq-item .om-faq-q-mark { font-size: 22px; }
  .om-faq-item .om-faq-q-text { font-size: 16px; }
}
