/*
Theme Name: Romano Mathematics
Theme URI: https://emmanuelle.site
Author: Romano Emmanuelle
Description: Lightweight bilingual mathematics profile with KaTeX-powered notes.
Version: 1.0.1
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: romano-math
*/

:root {
  color-scheme: light;
  --accent-900: #84320f;
  --accent-800: #b54b17;
  --accent-700: #df7028;
  --accent-100: #f6d7b2;
  --bg: #fbf4e8;
  --ink: #35261c;
  --muted: #776052;
  --line: #e5cbb0;
  --surface: #fffdf8;
  --on-brand: #fff;
  font-family: Aptos, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17110d;
  --ink: #f7e9dc;
  --muted: #cbb3a1;
  --line: #5c4132;
  --surface: #261a14;
  --on-brand: #fff7ee;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; height: auto; }
[data-lang] { display: none !important; }
html[data-language="en"] [data-lang="en"],
html[data-language="ja"] [data-lang="ja"] { display: revert !important; }

.site-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  width: 280px; padding: 34px 22px 24px;
  display: flex; flex-direction: column; overflow-y: auto;
  color: var(--on-brand);
  background: linear-gradient(165deg, #6f250b 0%, #c85b1c 62%, #e87f2f 100%);
  box-shadow: 6px 0 18px rgba(156,0,81,.18);
}
html[data-theme="dark"] .sidebar { background: linear-gradient(165deg, #17110d 0%, #5b210c 68%, #974012 100%); }
.identity { font-size: 25px; font-weight: 750; line-height: 1.08; letter-spacing: -.03em; }
.identity-meta { margin: 22px 0 0; color: rgba(255,255,255,.78); font-size: 12px; font-weight: 500; }
.preferences { display: flex; gap: 8px; margin-top: 22px; }
.language-switch { flex: 1; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(0,0,0,.12); }
.language-switch button, .theme-toggle { border: 0; color: rgba(255,255,255,.78); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.language-switch button { padding: 7px 5px; border-radius: 5px; }
.language-switch button[aria-pressed="true"] { color: #84320f; background: white; }
.theme-toggle { width: 39px; height: 39px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(0,0,0,.12); font-size: 19px; }
.main-nav { margin-top: 30px; display: grid; gap: 7px; }
.main-nav a { padding: 12px 14px; border-radius: 9px; background: rgba(255,255,255,.1); font-size: 14px; font-weight: 650; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a[aria-current="page"] { color: #84320f; background: white; outline: none; }
.sidebar-foot { margin-top: auto; padding-top: 40px; color: rgba(255,255,255,.62); font-size: 11px; }

.site-content { margin-left: 280px; min-height: 100vh; padding: 48px clamp(28px,5vw,78px) 28px; }
.content-inner { width: min(940px,100%); margin: 0 auto; }
.portfolio-hero { min-height: 650px; display: grid; grid-template-columns: minmax(270px,.85fr) minmax(360px,1.15fr); overflow: hidden; border-radius: 15px; border-left: 5px solid var(--accent-700); background: var(--surface); box-shadow: 0 8px 24px rgba(194,24,104,.16); }
.portfolio-photo { display: grid; place-items: center; padding: clamp(42px,6vw,68px) clamp(32px,4vw,54px); background: radial-gradient(circle at 70% 22%,rgba(255,191,222,.55),transparent 31%),linear-gradient(145deg,var(--accent-100),#fff7ee); border-right: 1px solid var(--line); }
html[data-theme="dark"] .portfolio-photo { background: radial-gradient(circle at 70% 22%,rgba(216,79,143,.22),transparent 31%),linear-gradient(145deg,#2a1811,#21150f); }
.portrait-frame { width: min(100%,330px); aspect-ratio: 4/5; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: repeating-linear-gradient(135deg,transparent 0 24px,rgba(118,88,103,.08) 24px 25px),var(--surface); box-shadow: 15px 15px 0 rgba(232,62,140,.28); }
.portrait-frame span { font-size: 15px; font-weight: 700; }
.portfolio-intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(42px,7vw,82px); }
.portfolio-intro h1 { margin: 0; color: var(--accent-900); font-size: clamp(52px,7vw,92px); line-height: .87; letter-spacing: -.065em; }
.portfolio-intro h1 em { display: block; color: var(--accent-700); font-style: normal; }
.portfolio-summary { margin: 42px 0 0; color: var(--muted); font-size: 18px; }
.portfolio-summary a { display: block; color: var(--accent-800); text-decoration: underline; text-underline-offset: 3px; }

.page-heading { margin-bottom: 22px; padding: 38px clamp(24px,5vw,52px); border-radius: 14px; color: white; background: linear-gradient(135deg,#65240c 0%,#b94b16 58%,#f09a4d 100%); }
html[data-theme="dark"] .page-heading { background: linear-gradient(135deg,#30150c 0%,#7b2b0d 55%,#c65c1e 100%); }
.page-heading h1 { margin: 0; font-size: clamp(34px,5vw,58px); letter-spacing: -.045em; }
.page-heading p { max-width: 680px; margin: 14px 0 0; color: rgba(255,255,255,.86); }
.card { margin-bottom: 18px; padding: clamp(22px,4vw,38px); border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 5px 20px rgba(174,28,101,.08); }
.card h2 { margin: 0 0 18px; color: var(--accent-900); font-size: 24px; }
.card p:last-child { margin-bottom: 0; }
.inline-link, .entry-content a { color: var(--accent-800); text-decoration: underline; text-underline-offset: 3px; }
.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 170px 1fr; gap: 22px; padding: 20px 0; border-top: 1px solid var(--line); }
.timeline-item:first-child { border-top: 0; }
.timeline-item time { color: var(--muted); font-size: 12px; font-weight: 700; }
.timeline-item h3 { margin: 0 0 5px; color: var(--accent-900); font-size: 17px; }
.timeline-item p { margin: 0; color: var(--muted); }

.notes-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.note-card { min-height: 220px; padding: 24px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.note-card:hover { border-color: var(--accent-700); }
.note-card small { color: var(--accent-800); font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.note-card h3 { margin: 18px 0 8px; color: var(--accent-900); font-size: 21px; line-height: 1.25; }
.note-card p { margin: 0; color: var(--muted); }
.note-card .read-more { margin-top: auto; padding-top: 22px; color: var(--accent-800); font-size: 12px; font-weight: 750; }
.post-list { display: grid; gap: 12px; }
.post-row { padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.post-row h3 { margin: 5px 0 7px; color: var(--accent-900); }
.post-row time { color: var(--muted); font-size: 12px; }

.article-shell { max-width: 820px; margin: 0 auto; padding: 20px 0 50px; }
.article-header { margin-bottom: 34px; }
.article-header a { color: var(--accent-800); font-size: 12px; font-weight: 700; }
.article-header h1 { margin: 22px 0 10px; color: var(--accent-900); font-family: Georgia,"Times New Roman",serif; font-size: clamp(38px,6vw,62px); line-height: 1.08; }
.entry-content { font-family: Georgia,"Times New Roman",serif; font-size: 18px; line-height: 1.9; }
.entry-content h2 { margin-top: 50px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-700); color: var(--accent-900); }
.entry-content pre { overflow-x: auto; padding: 18px; border-radius: 9px; background: var(--surface); }
.entry-content .katex-display { overflow-x: auto; overflow-y: hidden; }
.site-footer { width: min(940px,100%); margin: 28px auto 0; padding-top: 20px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
  .sidebar { width: 245px; }
  .site-content { margin-left: 245px; }
  .portfolio-hero { grid-template-columns: 1fr; }
  .portfolio-photo { min-height: 450px; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .sidebar { position: sticky; inset: 0 auto auto 0; width: 100%; min-height: 0; padding: max(10px,env(safe-area-inset-top)) clamp(12px,4vw,20px) 10px; flex-flow: row wrap; align-items: center; gap: 8px 12px; overflow: visible; box-shadow: 0 4px 18px rgba(156,0,81,.18); }
  .identity { font-size: clamp(16px,4.6vw,20px); white-space: nowrap; }
  .identity br, .identity-meta, .sidebar-foot { display: none; }
  .preferences { margin: 0 0 0 auto; }
  .language-switch { width: 112px; }
  .main-nav { order: 3; width: 100%; margin: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { flex: 1 0 auto; padding: 8px 11px; font-size: 11px; text-align: center; }
  .site-content { margin-left: 0; padding: clamp(18px,5vw,30px) clamp(12px,4vw,24px) 24px; }
  .portfolio-hero { min-height: 0; border-left: 0; border-top: 4px solid var(--accent-700); }
  .portfolio-photo { min-height: clamp(260px,78vw,390px); padding: 30px; }
  .portrait-frame { width: min(65vw,270px); box-shadow: 10px 10px 0 rgba(232,62,140,.25); }
  .portfolio-intro { padding: 38px 22px; }
  .portfolio-intro h1 { font-size: clamp(42px,15vw,72px); overflow-wrap: anywhere; }
  .notes-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 5px; }
  .site-footer { flex-direction: column; gap: 6px; }
}

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

/* Complete local-site content */
.identity-links { margin: 18px 0 0; display: grid; gap: 4px; color: rgba(255,255,255,.82); font-size: 11px; line-height: 1.45; }
.identity-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.contact-line { margin: 10px 0 0; color: rgba(255,255,255,.62); font-size: 11px; }
.home-name-kana { margin-bottom: 18px; color: var(--accent-800); font-weight: 700; letter-spacing: .08em; }
.portrait-frame { grid-auto-flow: row; align-content: center; gap: 8px; text-align: center; }
.portrait-frame strong { color: var(--accent-900); font-size: 16px; }
.portrait-frame small { color: var(--muted); font-weight: 650; }
.portrait-mark { width: 56px; height: 56px; margin: 0 auto 8px; display: block!important; border: 1px solid var(--line); border-radius: 50%; background: linear-gradient(135deg,var(--accent-100),var(--surface)); }
.portfolio-rule { width: 74px; height: 4px; margin-top: 35px; border-radius: 4px; background: var(--accent-700); }
.page-heading>span { display: block; margin-bottom: 7px; color: rgba(255,255,255,.75); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.academic-card>h3 { margin: 30px 0 10px; color: var(--accent-900); font-size: 19px; }
.timeline-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.publication>a { color: var(--accent-800); font-family: Georgia,"Times New Roman",serif; font-size: 20px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.publication p { color: var(--muted); }
.running-bests { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 22px 0 30px; }
.running-best { padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.running-best-head { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.running-best-head strong { color: var(--accent-900); }
.running-best-head span { color: var(--accent-800); font-size: 24px; font-weight: 800; }
.running-best>p { margin: 5px 0 14px; color: var(--muted); font-size: 11px; }
.running-best dl { margin: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.running-best dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.running-best dd { margin: 2px 0 0; font-size: 12px; font-weight: 700; }
.faq-list { display: grid; gap: 0; }
.faq-list article { padding: 21px 0; border-top: 1px solid var(--line); }
.faq-list article:first-child { padding-top: 0; border-top: 0; }
.faq-list h3 { margin: 0 0 7px; color: var(--accent-900); }
.faq-list p { margin: 0; color: var(--muted); }
.section-intro { margin: -4px 0 24px; color: var(--muted); }
.page-notes .note-card { min-height: 285px; }
.note-topic { color: var(--accent-800); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.note-level { margin-top: 6px; color: var(--muted); font-size: 11px; }
.note-card>strong { margin: 22px 0 9px; color: var(--accent-900); font-size: 20px; line-height: 1.25; }
.note-summary { color: var(--muted); font-size: 14px; }
.read-note { margin-top: auto; padding-top: 20px; color: var(--accent-800); font-size: 12px; font-weight: 800; }
.featured-link strong { display: block; margin: 7px 0; color: var(--accent-900); font-size: 21px; }
.featured-link span,.featured-link small { color: var(--muted); font-size: 11px; }
.featured-link p { margin: 0 0 10px; color: var(--muted); }
.contact-primary { display: inline-block; margin-top: 8px; color: var(--accent-800); font-size: clamp(18px,3vw,28px); font-weight: 750; text-decoration: underline; text-underline-offset: 5px; }
.article-kicker { display: block; margin-top: 25px; color: var(--accent-800); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.article-header>p { color: var(--muted); font-size: 17px; }
.math-callout { margin: 28px 0; padding: 22px 24px; border: 1px solid var(--line); border-left: 4px solid var(--accent-700); border-radius: 9px; background: var(--surface); }
.math-callout>strong { color: var(--accent-900); font-family: Aptos,Inter,ui-sans-serif,system-ui,sans-serif; font-size: 13px; letter-spacing: .04em; }
.math-callout p:last-child { margin-bottom: 0; }
.math-callout.proof { border-left-color: var(--muted); }
.math-note-content ol { padding-left: 24px; }

@media (max-width:700px) {
  .identity-links,.contact-line { display:none; }
  .running-bests { grid-template-columns:1fr; }
  .running-best dl { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .page-notes .note-card { min-height:230px; }
  .math-callout { padding:18px; }
}



.portrait-frame {
  overflow: hidden;
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==================================================
   ROMANO CUSTOM — AUTUMN, HOME, FONT, MAINTENANCE
   Hapus hanya bagian UNDER CONSTRUCTION untuk membuka Notes & Blog.
   ================================================== */

:root {
  --accent-900: #84320f;
  --accent-800: #b54b17;
  --accent-700: #df7028;
  --accent-100: #f6d7b2;
  --bg: #fbf4e8;
  --surface: #fffdf8;
  --ink: #35261c;
  --muted: #776052;
  --line: #e5cbb0;
  --on-brand: #fffaf3;
  --font-global: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --accent-900: #ffb469;
  --accent-800: #f49345;
  --accent-700: #ff9b45;
  --accent-100: #59321d;
  --bg: #17110d;
  --surface: #261a14;
  --ink: #f7e9dc;
  --muted: #cbb3a1;
  --line: #5c4132;
  --on-brand: #fff7ee;
}

html,
body,
button,
input,
textarea,
select {
  font-family: var(--font-global);
}

.sidebar {
  background: linear-gradient(165deg, #74290e 0%, #b94716 52%, #e7852e 100%);
  box-shadow: 6px 0 18px rgba(92, 39, 15, .2);
}

html[data-theme="dark"] .sidebar {
  background: linear-gradient(165deg, #1d110c 0%, #482014 55%, #793619 100%);
  box-shadow: 6px 0 22px rgba(0, 0, 0, .38);
}

.page-heading {
  background: linear-gradient(135deg, #792a0c 0%, #bb4b17 56%, #e98a31 100%);
}

html[data-theme="dark"] .page-heading {
  background: linear-gradient(135deg, #30150c 0%, #5c2916 55%, #91451f 100%);
}

.language-switch button[aria-pressed="true"],
.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a[aria-current="page"] {
  color: #7a2b0d;
  background: #fff8ed;
}

html[data-theme="dark"] .language-switch button[aria-pressed="true"],
html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .main-nav a:focus-visible,
html[data-theme="dark"] .main-nav a[aria-current="page"] {
  color: #422010;
  background: #efc187;
}

.card { box-shadow: 0 5px 20px rgba(120, 56, 20, .1); }
html[data-theme="dark"] .card { box-shadow: 0 6px 22px rgba(0, 0, 0, .28); }

.note-card:hover {
  border-color: var(--accent-700);
  box-shadow: 0 8px 22px rgba(151, 70, 23, .12);
}

html[data-theme="dark"] .note-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
}

.portrait-frame { overflow: hidden; box-shadow: 15px 15px 0 rgba(202, 91, 29, .27); }
.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

html[data-theme="dark"] .portrait-frame {
  box-shadow: 15px 15px 0 rgba(223, 112, 40, .18);
}

html[data-theme="dark"] .portrait-frame img {
  filter: brightness(.9) contrast(1.04) saturate(.94);
}

body.home .portfolio-hero {
  min-height: min(650px, calc(100svh - 96px));
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.home .portfolio-photo,
html[data-theme="dark"] body.home .portfolio-photo,
body.home .portfolio-intro {
  border: 0;
  background: transparent;
}

::selection { color: #fffaf2; background: #b64a17; }

/* NOTES & BLOG — UNDER CONSTRUCTION
   Hapus blok dari komentar ini sampai END UNDER CONSTRUCTION untuk membukanya lagi. */
body:has(.page-notes) .content-inner > * { display: none !important; }

body:has(.page-notes) .content-inner {
  min-height: calc(100svh - 100px);
  padding: clamp(40px, 8vw, 90px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(circle at top, color-mix(in srgb, var(--accent-100) 65%, transparent), transparent 48%), var(--surface);
  box-shadow: 0 12px 35px rgba(104, 48, 18, .12);
}

body:has(.page-notes) .content-inner::before {
  content: "UNDER CONSTRUCTION";
  color: var(--accent-900);
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.045em;
}

body:has(.page-notes) .content-inner::after {
  content: "Notes & Blog are under construction. Please check back later.";
  max-width: 560px;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.7;
}

html[data-language="ja"] body:has(.page-notes) .content-inner::before { content: "工事中"; }
html[data-language="ja"] body:has(.page-notes) .content-inner::after { content: "ノート・ブログは現在準備中です。しばらくしてからもう一度ご覧ください。"; }

html[data-theme="dark"] body:has(.page-notes) .content-inner {
  background: radial-gradient(circle at top, rgba(185, 85, 31, .2), transparent 48%), var(--surface);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .32);
}
/* END UNDER CONSTRUCTION */

@media (max-width: 900px) {
  body.home .portfolio-hero { min-height: 0; }
}

@media (max-width: 700px) {
  body.home .portfolio-hero { gap: 18px; }
  body.home .portfolio-photo { min-height: 0; padding: 4px 4px 14px; }
  body.home .portrait-frame {
    width: min(78vw, 330px);
    aspect-ratio: 4 / 5;
    margin-inline: auto;
    box-shadow: 10px 10px 0 rgba(202, 91, 29, .22);
  }
  body.home .portfolio-intro { padding-inline: 4px; }
  body:has(.page-notes) .content-inner {
    min-height: calc(100svh - 155px);
    padding: 35px 22px;
    border-radius: 13px;
  }
}
