/* ===================================================
   CLAY — Terms & Privacy Page Styles  (css/terms.css)
   =================================================== */

/* ── 日本語の折り返し ───────────────────────────────
   対応ブラウザでは文節単位で改行する。「美容室の/セット面を」のように
   意味の切れ目で折り返るので、行頭に助詞だけが残る不格好な改行が消える。
   text-wrap: pretty は最終行に1〜2文字だけ落ちるのを防ぐ。

   【重要】土台は normal にすること。keep-all を土台にすると、
   auto-phrase 非対応のブラウザ（Safari）で日本語が一切折り返せなくなり、
   段組みからはみ出して隣の要素の下に潜り込む。normal は
   日本語の標準の折り返し（禁則つきで文字単位）で、これが正しい退避先。 */
h1, h2, h3, h4, h5,
p, li, dt, dd, figcaption, blockquote,
label, button, summary {
    line-break: strict;
    word-break: normal;
    word-break: auto-phrase;
    overflow-wrap: break-word;
}

p, li, dd, figcaption, blockquote {
    text-wrap: pretty;
}

h1, h2, h3 {
    text-wrap: balance;
}

:root {
    /* --gutter は tokens.css に集約済み（main.css を読まないページなので、
       tokens.css を最初に読み込むことで供給される） */
    --dark: #241f19;
    --border: #ddccb2;
    --silver: #7a6f5f;
    --silver-light: #a89a84;
    --white: #ffffff;
    --ivory: #f3e9dc;
    --card-bg: #fdf9f3;
    --accent: #b08a4e;
    --font-serif: 'Fraunces', 'Shippori Mincho', Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
    --font-sans: 'Inter', 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--ivory);
    color: var(--dark);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
    display: flex;
    align-items: center;
    padding: 24px calc(var(--gutter) + env(safe-area-inset-right)) 24px calc(var(--gutter) + env(safe-area-inset-left));
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

.header-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    text-decoration: none;
    color: var(--dark);
}

.header-logo .logo-img {
    display: block;
    height: 19px;
    width: auto;
}

.header-logo .logo-sub {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--silver);
    margin-bottom: 2px;
}

.header-wordmark {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: lowercase;
}

.header-logo .logo-dot {
    color: var(--accent);
}

/* ── Main ── */
.terms-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 24px 120px;
}

/* ── Nav ── */
.terms-nav {
    display: flex;
    gap: 24px;
    margin-bottom: 64px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.terms-nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--silver);
    text-decoration: none;
    transition: color 0.2s;
}

/* タブの文字高が25pxしかない。gapが24pxあるので左右も少し広げられる */
.terms-nav a {
    position: relative;
}

.terms-nav a::after {
    content: '';
    position: absolute;
    inset: -12px -8px;
}

.terms-nav a:hover {
    color: var(--accent);
}

/* ── Sections ── */
.terms-section {
    margin-bottom: 80px;
    scroll-margin-top: 40px;
}

.terms-section h1 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 0.02em;
    margin-bottom: 40px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.terms-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 12px;
}

.terms-section p {
    margin-bottom: 16px;
    color: var(--dark);
}

/* 本文中のURLなど途中で折り返せない長い文字列が、狭い端末（〜320px）で
   横スクロールを発生させていた。単語の途中でも折り返せるようにする。 */
.terms-section p,
.terms-section li,
.terms-section dd {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.terms-section ol,
.terms-section ul {
    margin-left: 1.5em;
    margin-bottom: 16px;
}

.terms-section li {
    margin-bottom: 8px;
}

.terms-section ul {
    list-style: disc;
}

/* ── Company Info (dl) ── */
.company-info {
    margin-top: 12px;
    margin-bottom: 16px;
}

.company-info dt {
    font-weight: 600;
    font-size: 13px;
    color: var(--silver);
    margin-top: 8px;
}

.company-info dd {
    margin-left: 0;
}

.company-info a {
    color: var(--accent);
    text-decoration: none;
}

.company-info a:hover {
    text-decoration: underline;
}

/* ── Footer ── */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 100px calc(var(--gutter) + env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) calc(var(--gutter) + env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-copy {
    font-size: 12px;
    color: var(--silver-light);
    font-weight: 400;
}

.footer-links {
    display: flex;
    gap: 100px;
}

.footer-links a {
    font-size: 14px;
    font-weight: 400;
    color: var(--silver);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .site-header {
        padding: 20px 24px;
    }

    .terms-main {
        padding: 48px 20px 80px;
    }

    .terms-section h1 {
        font-size: 24px;
    }

    .site-footer {
        padding: 48px 24px;
        gap: 32px;
    }

    .footer-links {
        flex-direction: column;
        gap: 16px;
    }
}

/* ── タップ領域の確保（terms.css は独自の footer-links / header-logo を持つ） ── */
.footer-links a,
.header-logo,
.terms-contact a,
dd a[href^="mailto:"] {
    position: relative;
}

.footer-links a::after,
.header-logo::after,
dd a[href^="mailto:"]::after {
    content: '';
    position: absolute;
    inset: -12px -10px;
}
