/*
Theme Name: Nishizawa
Theme URI: https://nishizawa2438.com/
Description: 純米酒・本格焼酎 ニシザワ（東京都墨田区吾妻橋）公式サイト用カスタムテーマ。来店促進・ローカルSEO・E-E-A-T・AI検索（GEO）対応。
Author: 株式会社ニシザワ
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nishizawa
*/

/* ===== Design Tokens ===== */
:root {
  --ai: #1C3D52;
  --ai-dark: #142C3D;
  --ai-soft: #2E5872;
  --kan: #C8822E;
  --kan-dark: #A86A1F;
  --kinari: #F7F1E6;
  --kinari-2: #EFE7D7;
  --sumi: #211B16;
  --sumi-70: #514941;
  --sumi-45: #847b71;
  --koke: #6E7A55;
  --koke-soft: #E5E8DC;
  --haku: #FFFFFF;
  --line: #DED3BF;

  --font-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;

  --step--1: clamp(0.82rem, 0.78rem + 0.2vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.18rem, 1.08rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.4rem, 1.2rem + 1vw, 1.9rem);
  --step-3: clamp(1.7rem, 1.35rem + 1.7vw, 2.6rem);
  --step-4: clamp(2.1rem, 1.55rem + 2.7vw, 3.4rem);

  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2.5rem;
  --sp-5: 4rem;
  --sp-6: 6rem;

  --maxw: 1100px;
  --maxw-narrow: 760px;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 6px 24px rgba(33, 27, 22, 0.08);
  --shadow-lg: 0 14px 40px rgba(33, 27, 22, 0.12);

  --z-base: 1;
  --z-header: 30;
  --z-menu: 40;
  --z-skip: 60;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.8;
  color: var(--sumi);
  background: var(--kinari);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  word-break: normal;
  line-break: strict;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--ai); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--kan-dark); }
ul, ol { padding-left: 1.2em; }
button { font: inherit; cursor: pointer; }

/* ===== Accessibility ===== */
:focus-visible { outline: 3px solid var(--kan); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: var(--sp-2); top: -100px; z-index: var(--z-skip);
  background: var(--ai); color: #fff; padding: 0.7em 1.2em; border-radius: var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus { top: var(--sp-2); color: #fff; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== Layout ===== */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-2); }
.container--narrow { max-width: var(--maxw-narrow); }
.section { padding-block: var(--sp-5); }
.section--tint { background: var(--kinari-2); }
.section--ai { background: var(--ai); color: var(--kinari); }
.section--ai a { color: #fff; }

/* ===== Typography ===== */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.4; letter-spacing: 0.04em; color: var(--ai); text-wrap: balance; word-break: auto-phrase; }
.section--ai h1, .section--ai h2, .section--ai h3 { color: var(--kinari); }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin-block: 0 1em; text-wrap: pretty; }
.lead { font-size: var(--step-1); color: var(--sumi-70); }
.hero p, .hero h1, .lead { word-break: auto-phrase; }
.muted { color: var(--sumi-45); }
.measure { max-width: 38em; }

/* Section eyebrow (縦書きシグネチャー) */
.section-head { margin-bottom: var(--sp-4); }
.eyebrow {
  display: inline-block; font-family: var(--font-serif); font-weight: 600;
  color: var(--kan-dark); letter-spacing: 0.25em; font-size: var(--step--1);
  margin-bottom: 0.6em;
}
.eyebrow::before { content: ""; display: inline-block; width: 1.6em; height: 1px; background: var(--kan); vertical-align: middle; margin-right: 0.6em; }
.tate {
  writing-mode: vertical-rl; text-orientation: upright;
  font-family: var(--font-serif); letter-spacing: 0.25em; color: var(--kan-dark);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0.7em 1.5em; border-radius: 999px;
  font-family: var(--font-sans); font-weight: 700; font-size: var(--step-0);
  text-decoration: none; border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn-primary { background: var(--ai); color: #fff; }
.btn-primary:hover { background: var(--ai-dark); color: #fff; box-shadow: var(--shadow); }
.btn-accent { background: var(--kan); color: var(--sumi); }
.btn-accent:hover { background: var(--kan-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ai); border-color: var(--ai); }
.btn-ghost:hover { background: var(--ai); color: #fff; }
.section--ai .btn-ghost, .hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.7); }
.section--ai .btn-ghost:hover, .hero .btn-ghost:hover { background: #fff; color: var(--ai); border-color: #fff; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(247, 241, 230, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6em; text-decoration: none; color: var(--ai); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; line-height: 1.2; letter-spacing: 0.04em; }
.brand-name small { display: block; font-size: 0.62rem; color: var(--sumi-45); font-weight: 500; letter-spacing: 0.08em; }

.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; background: transparent; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ai); }
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.primary-nav { position: fixed; inset: 64px 0 auto 0; background: var(--kinari); border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform 0.25s ease; z-index: var(--z-menu); max-height: calc(100dvh - 64px); overflow-y: auto; }
.primary-nav.is-open { transform: translateY(0); }
.primary-nav ul { list-style: none; padding: var(--sp-2); margin: 0; display: flex; flex-direction: column; gap: 2px; }
.primary-nav a { display: block; padding: 0.9em 0.6em; text-decoration: none; color: var(--sumi); border-radius: var(--radius); font-weight: 500; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: var(--koke-soft); color: var(--ai); }
.header-cta { display: none; }

/* Language switch (Polylang) */
.lang-switch { display: flex; gap: 0.3em; list-style: none; margin: 0; padding: 0; align-items: center; }
.lang-switch li { line-height: 1; }
.lang-switch a { display: inline-block; padding: 0.4em 0.6em; font-size: var(--step--1); font-weight: 700; text-decoration: none; color: var(--ai); border: 1px solid var(--line); border-radius: 999px; }
.lang-switch a:hover, .lang-switch .current-lang a { background: var(--ai); color: #fff; border-color: var(--ai); }

/* ===== Hero ===== */
.hero { position: relative; background: var(--ai); color: var(--kinari); overflow: hidden; }
.hero-inner { position: relative; display: grid; gap: var(--sp-3); padding-block: var(--sp-5); }
.hero-eyebrow { writing-mode: vertical-rl; text-orientation: upright; font-family: var(--font-serif); font-weight: 600; letter-spacing: 0.3em; color: var(--kan); position: absolute; top: var(--sp-4); right: 0; height: 6em; font-size: var(--step-1); }
.hero h1 { color: var(--kinari); font-size: var(--step-4); }
.hero p { color: rgba(247,241,230,0.85); font-size: var(--step-1); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.hero-status { display: inline-flex; align-items: center; gap: 0.5em; font-size: var(--step--1); color: var(--kinari); background: rgba(255,255,255,0.1); padding: 0.4em 0.9em; border-radius: 999px; width: fit-content; }
.hero-status .dot { width: 0.6em; height: 0.6em; border-radius: 50%; background: #7DBE7A; flex: none; }
.hero-noren { position: absolute; inset: 0 0 auto 0; height: 14px; background: repeating-linear-gradient(90deg, var(--ai-dark) 0 28px, var(--ai-soft) 28px 56px); opacity: 0.5; z-index: 2; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.3; z-index: 0; }
.hero .hero-inner { position: relative; z-index: 1; }
.page-banner { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: var(--radius-lg); margin-top: var(--sp-3); border: 1px solid var(--line); }

/* ===== Cards ===== */
.grid { display: grid; gap: var(--sp-3); }
@media (min-width: 600px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 820px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--haku); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-body { padding: var(--sp-3); display: flex; flex-direction: column; gap: 0.6em; flex: 1; }
.card h3 { color: var(--ai); }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card .btn { margin-top: auto; align-self: flex-start; }

/* Badge (杉玉) */
.badge { display: inline-flex; align-items: center; gap: 0.4em; font-size: var(--step--1); font-weight: 700; color: var(--koke); background: var(--koke-soft); padding: 0.25em 0.7em; border-radius: 999px; width: fit-content; }
.badge svg { width: 1.1em; height: 1.1em; }

/* ===== Info / Hours ===== */
.info-grid { display: grid; gap: var(--sp-3); }
@media (min-width: 760px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.hours-table { width: 100%; border-collapse: collapse; background: var(--haku); border-radius: var(--radius); overflow: hidden; }
.hours-table th, .hours-table td { text-align: left; padding: 0.6em 0.9em; border-bottom: 1px solid var(--line); font-weight: 500; }
.hours-table th { font-family: var(--font-sans); color: var(--sumi-70); width: 9em; font-weight: 700; }
.hours-table tr:last-child th, .hours-table tr:last-child td { border-bottom: 0; }

/* ===== FAQ (CSS accordion / HTML always expanded) ===== */
.faq-item { background: var(--haku); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--sp-2); overflow: hidden; }
.faq-q { width: 100%; text-align: left; background: transparent; border: 0; padding: 1em 1.2em; font-family: var(--font-serif); font-weight: 600; color: var(--ai); font-size: var(--step-0); display: flex; justify-content: space-between; align-items: center; gap: 1em; }
.faq-q .faq-icon { flex: none; width: 1.1em; height: 1.1em; transition: transform 0.2s ease; }
.faq-q[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-a { padding: 0 1.2em; max-height: 0; overflow: hidden; transition: max-height 0.25s ease, padding 0.25s ease; }
.faq-q[aria-expanded="true"] + .faq-a { padding: 0 1.2em 1.2em; max-height: 60em; }
.no-js .faq-a { max-height: none; padding: 0 1.2em 1.2em; }

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: var(--step--1); color: var(--sumi-45); padding-block: var(--sp-2); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4em; padding: 0; margin: 0; }
.breadcrumb li::after { content: "›"; margin-left: 0.4em; color: var(--line); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { text-decoration: none; }

/* ===== CTA band ===== */
.cta-band { text-align: center; }
.cta-band .hero-actions { justify-content: center; }
.cta-band h2 { margin-bottom: var(--sp-2); }

/* ===== Posts ===== */
.post-list { display: grid; gap: var(--sp-3); }
.post-item { display: grid; gap: 0.3em; padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.post-item time { font-size: var(--step--1); color: var(--kan-dark); font-weight: 700; letter-spacing: 0.05em; }
.post-item a { font-family: var(--font-serif); font-weight: 600; text-decoration: none; color: var(--ai); }
.entry-content { font-size: var(--step-0); }
.entry-content :is(h2,h3) { margin-top: 1.8em; margin-bottom: 0.6em; }
.entry-content p { margin-bottom: 1.2em; }
.entry-content img { border-radius: var(--radius); margin-block: 1.5em; }

/* ===== Forms (CF7) ===== */
.wpcf7 label { display: block; font-weight: 700; margin-bottom: var(--sp-2); color: var(--sumi); }
.wpcf7 .required { color: #fff; background: var(--kan-dark); font-size: 0.7em; padding: 0.15em 0.6em; border-radius: 4px; margin-left: 0.5em; vertical-align: middle; }
.wpcf7-form-control { width: 100%; padding: 0.75em 0.9em; margin-top: 0.4em; font: inherit; color: var(--sumi); background: var(--haku); border: 1px solid var(--line); border-radius: var(--radius); }
.wpcf7-form-control:focus { border-color: var(--ai); outline: 3px solid rgba(28,61,82,0.18); outline-offset: 0; }
textarea.wpcf7-form-control { min-height: 8em; resize: vertical; }
.wpcf7-submit { min-height: 48px; padding: 0.7em 2em; background: var(--ai); color: #fff; border: 0; border-radius: 999px; font-weight: 700; }
.wpcf7-submit:hover { background: var(--ai-dark); }
.wpcf7 .honeypot-field { position: absolute; left: -9999px; }

/* ===== Footer ===== */
.site-footer { background: var(--ai-dark); color: rgba(247,241,230,0.85); padding-block: var(--sp-5) var(--sp-3); margin-top: var(--sp-5); }
.site-footer a { color: rgba(247,241,230,0.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h3 { color: var(--kinari); font-size: var(--step-0); margin-bottom: var(--sp-2); }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5em; }
.footer-meta { font-size: var(--step--1); color: rgba(247,241,230,0.7); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: var(--sp-4); padding-top: var(--sp-3); font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; }

/* ===== Map ===== */
.map-embed { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .faq-icon, .faq-a, .primary-nav { transition: none; }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-3 { margin-top: var(--sp-3); }
.stack > * + * { margin-top: var(--sp-2); }
.flow > * + * { margin-top: 1em; }
.tel-link { font-family: var(--font-serif); font-weight: 700; font-size: var(--step-1); color: var(--ai); text-decoration: none; letter-spacing: 0.04em; }

/* ===== Desktop nav ===== */
@media (min-width: 1000px) {
  .nav-toggle { display: none; }
  .primary-nav { position: static; transform: none; background: transparent; border: 0; max-height: none; overflow: visible; }
  .primary-nav ul { flex-direction: row; flex-wrap: nowrap; gap: 0.1em; padding: 0; }
  .primary-nav a { padding: 0.5em 0.7em; font-size: var(--step--1); }
  .header-cta { display: inline-flex; }
}

/* ===== Header refinements (readability) ===== */
.site-header .header-inner { max-width: 1280px; }
.primary-nav a { white-space: nowrap; }
.lang-switch a { white-space: nowrap; }
.header-cta { white-space: nowrap; }
@media (min-width: 1000px) {
  .header-inner { gap: 0.7rem; }
  .brand-name { font-size: 1rem; }
  .brand-name small { font-size: 0.6rem; }
  .header-cta { min-height: 40px; padding: 0.4em 1em; font-size: var(--step--1); }
  .lang-switch a { padding: 0.35em 0.6em; }
}

/* ===== Hero: fill one screen ===== */
.hero { min-height: calc(100svh - 64px); display: flex; align-items: center; }
.hero-inner { width: 100%; }
@supports not (height: 100svh) { .hero { min-height: calc(100vh - 64px); } }
@media (min-width: 1000px) {
  .hero h1 { font-size: clamp(2.6rem, 1.8rem + 3vw, 4.2rem); }
  .hero p { font-size: var(--step-2); }
}

/* ===== Sake pour click effect ===== */
.nz-drop { position: fixed; z-index: 9999; pointer-events: none; width: 7px; height: 11px; background: linear-gradient(180deg, #E8B86A, #C8822E); border-radius: 50% 50% 50% 50% / 65% 65% 38% 38%; opacity: 0.9; will-change: transform, opacity; }
.nz-splash { position: fixed; z-index: 9998; pointer-events: none; border: 2px solid var(--kan); border-radius: 50%; opacity: 0.5; will-change: transform, opacity; }
@keyframes nz-pour { from { opacity: 0.9; transform: translateY(-4px) scale(1); } to { opacity: 0; transform: translateY(36px) scale(0.5); } }
@keyframes nz-splash { from { opacity: 0.5; transform: scale(0.3); } to { opacity: 0; transform: scale(1.7); } }
@media (prefers-reduced-motion: reduce) { .nz-drop, .nz-splash { display: none; } }

/* ===== Custom cursor (徳利 / tokkuri) ===== */
body { cursor: url('images/tokkuri.png') 18 3, auto; }
a, button, .btn, .faq-q, summary, [role="button"], .nav-toggle, label[for] { cursor: url('images/tokkuri.png') 18 3, pointer; }
input, textarea, select { cursor: auto; }
