/*
SG Greenfield — AFFINGER7 default-chrome suppression for HOME / EVENT / DAY.
Task: SG-MEDIA-WORDPRESS-PRESENTATION-FRONTEND-FIX-01

This file is intentionally separate from sg-design-system.css, which is
scoped exclusively to `.sg-*` classes (see its own header comment) and must
not be redefined to touch AFFINGER's own markup. This file does the
opposite on purpose: it targets AFFINGER's existing structural selectors
(#content-w, #content, #side, .sns, .kanren) — confirmed via a live,
read-only fetch of https://kyotei-sg.needful.jp/ on 2026-09-03 — and hides/
resizes them only on the specific pages this Task covers. No AFFINGER
Parent file is edited; no new page templates, no PHP layout logic, no JS.

Selector scope:
  .page-id-8       HOME (WordPress page id=8)
  .single-sg_record  every sg_record single (Event id=22, DAY 23/24/25;
                     also DAY4-6/legacy 6-7 if/when they are ever viewed —
                     same presentation is intentionally desired site-wide
                     for this CPT, not just the 3 currently-finished DAYs)

What this hides, and why (STEP4/STEP5 of the Task):
  #side              default AFFINGER sidebar (search widget etc.)
  .sns               default SNS share button row (Hatena/LINE/note/URL copy)
  .kanren            default "related posts" block
  #comments, .comment-respond  default comment UI (belt-and-suspenders;
                     comments are already closed site-wide in Settings)

What this does NOT touch:
  Post type registration, REST base, slugs, CPT `sg_record` definition,
  meta, Prediction/Result/Verification content, any other page/post not
  matching the two selectors above (About/Policy/Contact/Archive keep
  AFFINGER's normal layout).
*/

.page-id-8 #side,
.single-sg_record #side,
.page-id-8 .sns,
.single-sg_record .sns,
.page-id-8 .kanren,
.single-sg_record .kanren,
.page-id-8 #comments,
.single-sg_record #comments,
.page-id-8 .comment-respond,
.single-sg_record .comment-respond {
  display: none !important;
}

/* #content-w is AFFINGER's two-column wrapper (#content + #side). With
   #side hidden above, #content is widened to fill the freed space. Both
   float- and flex-based AFFINGER layouts are covered defensively since the
   exact mechanism was not confirmed live (no page-id-8/single-sg_record
   page could be fetched while still in draft status). */
.page-id-8 #content-w,
.single-sg_record #content-w {
  display: block !important;
}

.page-id-8 #content-w #content,
.single-sg_record #content-w #content {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  flex: none !important;
}

/* Defensive: hide a plain post-date element if AFFINGER renders one on
   this template (class name not confirmed live for page/sg_record
   singles specifically — harmless no-op if absent). */
.page-id-8 .entry-date,
.single-sg_record .entry-date,
.page-id-8 .post-date,
.single-sg_record .post-date {
  display: none !important;
}

/* =====================================================================
   VISUAL DELTA 03 (Task: SG-MEDIA-WORDPRESS-PRESENTATION-VISUAL-DELTA-03)

   Why !important is required here, and why this lives in THIS file:
   AFFINGER's Customizer-generated stylesheet
   (/wp-content/uploads/affinger-cache/st-themecss-pc.css) is enqueued
   AFTER both sg-design-system.css and this file — confirmed by reading
   the live <link> order on 2026-09-03. Its heading/table rules therefore
   win the cascade over the .sg-* palette, which is what made headings
   render near-black on the dark navy SG panels. sg-design-system.css is
   deliberately NOT edited (it stays the .sg-*-only design primitive);
   the correction is applied here as a scoped override instead.

   Measured before this block (DAY1 id=23, real CSS, real content):
     h2                    #1A1A1A on #0A111E -> contrast 1.09  (unreadable)
     h2.sg-section__heading #1A1A1A on #121D30 -> contrast 1.03  (unreadable)
     .sg-boat-table th     light text on forced #FAFAFA -> contrast 1.13
     .sg-section__label    #6B7A8F on #16233A -> contrast 3.60  (below AA)
     .sg-updated-at        #6B7A8F on #121D30 -> contrast 3.86  (below AA)
   h1 / h3 / body text / links already passed and are only re-asserted
   defensively. No new colors are introduced — every value below is an
   existing sg-design-system.css token.
--------------------------------------------------------------------- */

/* 1a. Headings inside SG panels must use the light palette, not AFFINGER's
       dark article-heading color. */
.page-id-8 .sg-scope h1,
.page-id-8 .sg-scope h2,
.page-id-8 .sg-scope h3,
.page-id-8 .sg-scope h4,
.page-id-8 .sg-scope h5,
.page-id-8 .sg-scope h6,
.single-sg_record .sg-scope h1,
.single-sg_record .sg-scope h2,
.single-sg_record .sg-scope h3,
.single-sg_record .sg-scope h4,
.single-sg_record .sg-scope h5,
.single-sg_record .sg-scope h6 {
  color: var(--sg-text) !important;
  background: transparent !important;
  border-color: var(--sg-line) !important;
}

/* 1b. Links inside SG panels keep the SG accent color in every state
       (AFFINGER sets its own link colors globally). */
.page-id-8 .sg-scope a,
.single-sg_record .sg-scope a,
.page-id-8 .sg-scope a:visited,
.single-sg_record .sg-scope a:visited {
  color: var(--sg-cyan) !important;
}

/* 1c. Table header cells: AFFINGER forces a near-white th background
       (#FAFAFA), which collided with the light SG text. Restore the SG
       panel background so the existing light text is readable. */
.page-id-8 .sg-scope .sg-boat-table th,
.single-sg_record .sg-scope .sg-boat-table th {
  background: var(--sg-panel2) !important;
  color: var(--sg-text) !important;
  border-color: var(--sg-line) !important;
}

.page-id-8 .sg-scope .sg-boat-table td,
.single-sg_record .sg-scope .sg-boat-table td {
  color: var(--sg-text) !important;
  border-color: var(--sg-line-soft) !important;
}

/* 1d. Small supporting labels were below WCAG AA (4.5:1) on the panel
       backgrounds. Move them one step up the existing palette
       (--sg-faint -> --sg-muted), which measures ~6.7:1. */
.page-id-8 .sg-scope .sg-section__label,
.single-sg_record .sg-scope .sg-section__label,
.page-id-8 .sg-scope .sg-updated-at,
.single-sg_record .sg-scope .sg-updated-at,
.page-id-8 .sg-scope .sg-status--unreached,
.single-sg_record .sg-scope .sg-status--unreached {
  color: var(--sg-muted) !important;
}

/* 2. AFFINGER post date on sg_record singles.
      Markup (itiran-date-singular.php):
      <div class="blogbox"><p><span class="kdate">…<time class="updated">…</time></span></p></div> */
.single-sg_record .blogbox,
.single-sg_record .kdate {
  display: none !important;
}

/* 3. Related-posts block and the residual folder / tag / author meta UI
      on sg_record singles.

      - p.tagst          folder icon + the_category() + the_tags()
                         (single-type1.php, "タグ・カテゴリーリンク")
      - #contentInner aside
                         the post-footer <aside> that wraps st_author(),
                         the kanren related-posts block (whose
                         <h4 class="point">関連記事</h4> heading sits
                         OUTSIDE .kanren — that heading is what remained
                         visible after .kanren alone was hidden), and
                         AFFINGER's own prev/next post navigation.
                         The SG article supplies its own Event backlink
                         and 前/次のDAY navigation, so AFFINGER's is a
                         duplicate here.
      Scoped to #contentInner so the sidebar <aside> (already hidden
      separately) and any other region is untouched. */
.single-sg_record p.tagst,
.single-sg_record #contentInner aside {
  display: none !important;
}
