/* ============================================================
   geometric-base.css  — イラレブック 幾何学リデザイン共通CSS
   全記事共通。テーマカラーは各記事HTMLの :root 変数で上書き可能
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --geo-primary:   #1d2741;
  --geo-accent:    #2a6b4a;
  --geo-accent2:   #d4a017;
  --geo-bg:        #faf9f6;
  --geo-surface:   #ffffff;
  --geo-border:    #d4d0c8;
  --geo-text:      #2c2c2c;
  --geo-text-sub:  #6d7282;
  --geo-chat-l:    #f0f0ec;
  --geo-chat-r:    #fdf6e3;
  --geo-section:   var(--geo-primary);
  --geo-max-w:     820px;
  --geo-font:      'Noto Sans JP', 'Yu Gothic', 'Hiragino Kaku Gothic ProN', Arial, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--geo-font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--geo-text);
  background-color: var(--geo-bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1 { font-size: 1.75rem; line-height: 1.35; margin: 0 0 .5rem; font-weight: 700; }
h2 { font-size: 1.35rem; line-height: 1.5;  margin: 0 0 .4rem; font-weight: 700; }
h3 { font-size: 1.15rem; line-height: 1.45; margin: 0 0 .3rem; font-weight: 700; }
h4 { font-size: 1.05rem; line-height: 1.4;  margin: 0; font-weight: 700; }
h5 { font-size: 1rem;    line-height: 1.35; margin: 0; font-weight: 700; }
figcaption { font-size: 12px; line-height: 1.2; margin: 0; color: var(--geo-text-sub); }
ul { margin: 5px 0; padding-left: 1.5em; list-style-type: decimal; }

/* --- Links --- */
a { display: inline-block; color: var(--geo-primary); text-decoration: none; margin: 0; transition: opacity .2s; }
a:hover { opacity: .65; }
a.pull2  { color: var(--geo-primary); text-align: left; padding: 0; }
a.push   { color: #fff; background: var(--geo-accent); text-align: center; padding: 6px 16px; border: 2px solid var(--geo-accent); }
a.push0  { color: var(--geo-primary); text-decoration: underline; text-underline-offset: 3px; padding: 5px; }
a.push4  { color: var(--geo-primary); background: var(--geo-surface); text-align: center; padding: 5px 12px; border: 2px solid var(--geo-border); }
a.push6  { color: #2b0c1b; background: var(--geo-surface); text-align: center; padding: 5px 12px; }
a.push7  { color: #fff; background: #6a9b9d; text-align: center; padding: 5px 12px; }
a.push8  { color: #fff; background: #2b0c1b; text-align: center; padding: 5px 12px; }
a.push10 { color: #fff; background: var(--geo-primary); text-align: center; padding: 6px 16px; }
div.push8  { font-size: 24px; color: #2b0c1b; padding: 5px; }
div.push10 { font-size: 24px; color: var(--geo-primary); padding: 5px; }

/* --- Timestamp --- */
p.time {
  font-size: 12px;
  margin: 12px 0;
  padding: 8px 0;
  line-height: 1.4;
  color: var(--geo-text-sub);
  border-bottom: 1px solid var(--geo-border);
}

/* --- Layout Container --- */
.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  padding: 0 16px;
  margin: 0 auto;
  max-width: var(--geo-max-w);
}

.text {
  font-size: 16px;
  line-height: 1.85;
  margin: 0;
  padding: 0 0 24px;
  width: 100%;
}

/* --- Boxes (legacy grid) --- */
.box1, .box2, .box3 { text-align: center; cursor: pointer; transition: opacity .2s; }
.box1:hover, .box2:hover, .box3:hover { opacity: .65; }
.box1 { width: 96px;  flex-basis: 96px;  margin: 4px; padding: 4px; }
.box2 { width: 48px;  flex-basis: 48px;  margin: 2px; padding: 2px; }
.box3 { width: 170px; flex-basis: 50px;  margin: 0; padding: 0; }

/* --- Images --- */
img.sneak  { width: 100%; height: auto; display: block; }
img.sneakc { width: 100%; height: auto; display: block; }
img.index0, img.index, img.index1, img.index2 {
  width: 48px; height: 48px; object-fit: cover;
}

/* ============================================================
   BREADCRUMB — 幾何学ライン付き
   ============================================================ */
nav[aria-label="パンくずリスト"] {
  background: var(--geo-surface);
  padding: 12px 20px;
  font-size: 13px;
  border-bottom: 3px solid var(--geo-primary);
  position: relative;
}
nav[aria-label="パンくずリスト"]::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 120px;
  height: 3px;
  background: var(--geo-accent2);
}
nav[aria-label="パンくずリスト"] ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
nav[aria-label="パンくずリスト"] li {
  display: inline;
}
nav[aria-label="パンくずリスト"] a {
  color: var(--geo-primary);
  text-decoration: none;
}

/* ============================================================
   HEADER H1 — 幾何学アクセント
   ============================================================ */
header .container h1 {
  font-size: 1.6rem;
  line-height: 1.4;
  margin: 20px 0 12px;
  padding: 20px 24px;
  background: var(--geo-surface);
  border-left: 6px solid var(--geo-primary);
  position: relative;
  width: 100%;
}
header .container h1::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, transparent 50%, var(--geo-accent2) 50%);
  opacity: .25;
}

/* ============================================================
   DROPDOWN MENU — 幾何学パネル
   ============================================================ */
.dropbtn {
  background: var(--geo-primary);
  color: #fff;
  padding: 12px 20px;
  font-size: 15px;
  border: none;
  cursor: pointer;
}
.dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
}
.dropdown-content {
  display: none;
  position: absolute;
  background: var(--geo-surface);
  min-width: 240px;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  z-index: 10;
  border: 2px solid var(--geo-primary);
  max-height: 400px;
  overflow-y: auto;
}
.dropdown-content a {
  color: var(--geo-text);
  padding: 10px 16px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--geo-border);
  font-size: 14px;
}
.dropdown-content a:hover {
  background: #f0efe8;
  opacity: 1;
}
.dropdown-content a img {
  width: 28px;
  height: 28px;
  object-fit: cover;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown:hover .dropbtn { background: #162038; }

/* ============================================================
   SECTION TITLES — 幾何学タブ
   ============================================================ */
.SubtitleTab,
.SubtitleTabGray {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 12px 24px;
  margin: 32px 0 20px;
  text-align: center;
  text-decoration: none;
  border: none;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
}
.SubtitleTab {
  color: #fff;
  background: var(--geo-primary);
}
.SubtitleTab h2 {
  color: #fff;
  font-size: 1.25rem;
}
.SubtitleTabGray {
  color: #fff;
  background: #5a4a50;
}
.SubtitleTabGray h2 {
  color: #fff;
}

/* ============================================================
   TABLES — 幾何学グリッド
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--geo-primary);
  margin: 16px 0;
}
table th {
  padding: 12px 10px;
  background: #e8e6e0;
  border-bottom: 1px dashed var(--geo-border);
  font-weight: 700;
  text-align: left;
}
table td {
  padding: 12px 10px;
  border-bottom: 1px solid #eee;
}

/* Color variants */
table th.navy  { color: #fff; background: var(--geo-primary); }
table th.navy2 { color: #000; background: #c8c6be; }
table th.gray  { background: #b6a5ab; }
table th.black { color: #fff; background: #3a6b6c; border-bottom-color: #3a6b6c; }
table th.bk    { color: #fff; background: #2b0c1b; border-bottom-color: #2b0c1b; }

table td.red    { background: #fce8ea; border-bottom-color: #fce8ea; padding: 12px 10px; }
table td.yellow { background: #f5f3e4; border-bottom-color: #f5f3e4; padding: 12px 10px; }
table td.blue   { background: #e5f1ed; border-bottom-color: #e5f1ed; padding: 12px 10px; }
table td.purple { background: #f0e4ea; border-bottom-color: #f0e4ea; padding: 12px 10px; }
table td.gray   { background: #dad2d5; border-bottom-color: #c8bcc0; padding: 12px 10px; }
table td.black  { background: #d0d9da; border-bottom-color: #d0d9da; padding: 12px 10px; }
table td.navy   { background: #e7e8eb; border-bottom-color: #d0d9da; padding: 12px 10px; }
table td.bk     { color: #fff; background: #2b0c1b; border-bottom-color: #2b0c1b; padding: 12px 10px; }

/* Special table variants */
table.s         { border-color: #ff6054; }
table.s th.bks  { color: #ff6054; background: #2b0c1b; border-bottom: 1px solid #ff6054; }
table.s td.yellows { background: #f3e985; border-bottom: 1px solid #7d5231; padding: 12px 10px; }
table.s td.blues   { background: #c1f3f8; border-bottom: 1px solid #463b34; padding: 12px 10px; }
table.s td.bks     { background: #463b34; border-bottom: 1px solid #ff6054; padding: 12px 10px; }
table.s td.whites  { background: #fff; padding: 12px 10px; }

table.normal       { border-color: var(--geo-primary); }
table.normal th    { border: 1px dashed var(--geo-border); }
table.normal td    { border: 1px dashed var(--geo-border); }

table.Index        { border-collapse: collapse; text-align: left; }
table.Index td,
table.Index th     { border-bottom: 1px solid #e0ddd6; }
table.Index td     { padding: 6px 10px; }

/* ============================================================
   TOC (Index table) — 幾何学目次
   ============================================================ */
table.Index {
  border: 2px solid var(--geo-primary);
  background: var(--geo-surface);
}
table.Index th.navy {
  position: relative;
  padding: 14px;
}
table.Index th.navy h2 {
  color: #fff;
  font-size: 1.1rem;
  margin: 0;
}

/* ============================================================
   CHAT BUBBLES — 幾何学吹き出し
   ============================================================ */
.fuki::before { clear: both; content: ''; display: block; }
.fuki { margin: 20px 0; }
.fuki figure { margin: 0; display: block; }
.fuki figure img {
  width: 100%;
  height: 100%;
  margin: 0;
  vertical-align: middle;
  border: 2px solid var(--geo-border);
}

.fuki-img-left  { margin-left: 10px; margin-top: 1px; float: left; }
.fuki-img-right { margin-right: 10px; margin-top: 1px; float: right; }
.fuki-img-left,
.fuki-img-right { width: 90px; height: 90px; }

.fuki-img-name {
  padding: 0;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 400;
  text-align: center;
  display: block;
}

.chat-text-left,
.chat-text-right {
  position: relative;
  margin: 0 100px 16px;
  padding: 16px 20px;
  border: 2px solid;
}
.chat-text-left p,
.chat-text-right p {
  margin: 0 !important;
  font-size: 16px;
}

/* Left bubble — 幾何学(diamond accent) */
.chat-text-left {
  background: var(--geo-chat-l);
  border-color: var(--geo-border);
}
.chat-text-left::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -12px;
  width: 20px;
  height: 20px;
  background: var(--geo-chat-l);
  border-left: 2px solid var(--geo-border);
  border-bottom: 2px solid var(--geo-border);
  transform: rotate(45deg);
}
.chat-text-left::after { display: none; }

/* Right bubble */
.chat-text-right {
  background: var(--geo-chat-r);
  border-color: #e8d9a0;
}
.chat-text-right::before {
  content: '';
  position: absolute;
  top: 18px;
  right: -12px;
  width: 20px;
  height: 20px;
  background: var(--geo-chat-r);
  border-right: 2px solid #e8d9a0;
  border-top: 2px solid #e8d9a0;
  transform: rotate(45deg);
}
.chat-text-right::after { display: none; }

/* MK-style bubbles (for other articles) */
.mkmk-text-left,
.mkmk-text-right {
  position: relative;
  margin: 0 100px 16px;
  padding: 16px;
  border: 2px solid;
}
.mkmk-text-left p,
.mkmk-text-right p { margin: 0 !important; font-size: 16px; color: #555; }
.mkmk-text-left {
  background: #fceeeb;
  border-color: #f0cac2;
}
.mkmk-text-left::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -12px;
  width: 20px;
  height: 20px;
  background: #fceeeb;
  border-left: 2px solid #f0cac2;
  border-bottom: 2px solid #f0cac2;
  transform: rotate(45deg);
}
.mkmk-text-left::after { display: none; }
.mkmk-text-right {
  background: #b0e0e6;
  border-color: #9fd8df;
}
.mkmk-text-right::before {
  content: '';
  position: absolute;
  top: 18px;
  right: -12px;
  width: 20px;
  height: 20px;
  background: #b0e0e6;
  border-right: 2px solid #9fd8df;
  border-top: 2px solid #9fd8df;
  transform: rotate(45deg);
}
.mkmk-text-right::after { display: none; }

/* ============================================================
   TAG LINKS
   ============================================================ */
.tag-link {
  display: inline-block;
  background: #e8e6e0;
  color: var(--geo-text);
  padding: 5px 15px 5px 20px;
  text-decoration: none;
  font-size: 14px;
  position: relative;
  margin: 8px 4px;
  border: 1px solid var(--geo-border);
}
.tag-link::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 10px solid #e8e6e0;
}
.tag-link::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #fff;
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
}

/* ============================================================
   ARTICLE SUMMARY BOX
   ============================================================ */
.article-summary {
  border: 2px solid var(--geo-primary);
  padding: 20px;
  background: var(--geo-surface);
  margin-bottom: 24px;
}
.article-summary .heading {
  color: #fff;
  background: var(--geo-primary);
  font-size: 1.1em;
  padding: 6px 14px;
  display: inline-block;
  margin-bottom: 12px;
}
.article-summary .details { color: var(--geo-primary); margin-bottom: 15px; }
.article-summary .details p { margin: 5px 0; }
.article-summary .article-content { font-size: 1em; color: var(--geo-text); }
.article-summary .article-content p { margin: 10px 0; }
.article-summary .article-content p:first-child { font-weight: bold; }

/* ============================================================
   TWO COLUMN
   ============================================================ */
.two-column {
  columns: 2;
  -webkit-columns: 2;
  -moz-columns: 2;
}

/* ============================================================
   FOOTER — 幾何学パターン
   ============================================================ */
.copy {
  font-family: var(--geo-font);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  padding: 24px 16px;
  border: none;
  text-align: center;
  background: var(--geo-primary);
  color: #c8c6be;
  position: relative;
}
.copy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--geo-accent2) 0,
    var(--geo-accent2) 20px,
    transparent 20px,
    transparent 24px
  );
}
.copy a { color: #c8c6be; }

/* ============================================================
   GEOMETRIC DECORATIVE ACCENTS
   ============================================================ */

/* Section separator — 幾何学区切り線 */
section + section::before {
  content: '';
  display: block;
  margin: 32px auto 24px;
  width: 60%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--geo-border) 20%,
    var(--geo-primary) 50%,
    var(--geo-border) 80%,
    transparent
  );
}

/* Hero image wrapper */
#pickup img.sneak {
  border-bottom: 4px solid var(--geo-primary);
}

/* Nutrition table accent */
table.normal tr:first-child th {
  position: relative;
}

/* ============================================================
   ASIDE
   ============================================================ */
aside { display: none; }

/* ============================================================
   HOVER IMAGE
   ============================================================ */
.hoverImage { display: none; position: absolute; }

/* ============================================================
   RESPONSIVE — Mobile First
   ============================================================ */
@media (max-width: 767px) {
  .chat-text-left,
  .mkmk-text-left {
    margin-left: 90px;
    margin-right: 0;
  }
  .chat-text-right,
  .mkmk-text-right {
    margin-left: 0;
    margin-right: 90px;
  }
  .fuki-img-left,
  .fuki-img-right {
    width: 72px;
    height: 72px;
  }
  h1 { font-size: 1.4rem; }
  header .container h1 { padding: 16px 18px; font-size: 1.3rem; }
  .SubtitleTab, .SubtitleTabGray {
    clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
    min-height: 48px;
    padding: 10px 16px;
  }
}

@media (min-width: 550px) {
  img.sneakc { width: 50%; }
  .box3 { width: 400px; flex-basis: 100px; }
}

@media (min-width: 800px) {
  .container {
    width: var(--geo-max-w);
    padding: 0 16px;
    margin: 0 auto;
  }
  .box3 { width: 400px; flex-basis: 100px; }
}

@media (min-width: 1024px) {
  .container {
    width: var(--geo-max-w);
    padding: 0 16px;
    margin: 0 auto;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  body { background: #fff; }
  .dropdown-content, .copy::before { display: none; }
  .SubtitleTab, .SubtitleTabGray { clip-path: none; border: 2px solid #000; }
  a { color: #000; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
