/**
 * Time and Measurements Infographic
 * Page-specific styles (base styles in _base.css).
 * Moved from the legacy template-part inline <style> block 2026-06-12.
 */

:root {
    --wood-orange: #e07a00;
    --bg-cream: var(--special-page-outer-bg, #f8f6f1);
    --card-bg: #fffaf0;
    --stem-blue: #3b82f6;
    --stem-red: #ef4444;
    --stem-yellow: #f59e0b;
    --stem-white: #64748b;
    --stem-black: #1e293b;
    --clock-radius: 140px;
    --clock-size: 360px;
}

body.time-measurements-page .dict-alpha-nav {
    display: none;
}

body.time-measurements-page {
    color: var(--text-dark, #2c2c2c);
    font-family: var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    margin: 0;
    padding: 0;
    display: block;
    height: auto;
    min-height: 100%;
}

.time-measurements-layout {
    min-height: 100vh;
    padding: calc(70px + 2rem) 1rem 2rem;
}

.time-measurements-layout * {
    box-sizing: border-box;
}

/* Dictionary-entry links inherit the surrounding term styling. */
.time-measurements-layout a.tm-term-link {
    color: inherit;
    text-decoration: none;
}

.time-measurements-layout a.tm-term-link:hover {
    text-decoration: underline;
}

.infographic-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.header-branding {
    text-align: center;
    margin-bottom: 3rem;
}

.header-branding .subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-top: 0.5rem;
}

.section-title {
    font-family: var(--serif, "Noto Serif JP", serif);
    border-bottom: 2px solid var(--wood-orange);
    display: inline-block;
    margin-bottom: 1.2rem;
    color: var(--wood-dark);
    font-size: 1.5rem;
    font-weight: 700;
}

.section-title .section-subtitle {
    font-size: 0.7em;
    font-weight: 600;
    color: #6b7280;
    margin-left: 0.4rem;
}

.section-title.center {
    width: 100%;
    border: none;
    text-align: center;
    margin-bottom: 0;
}

.hub-card {
    background: var(--special-page-surface-bg, #ffffff);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--line-gray, #e5e7eb);
}

.zodiac-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* avoid vertical centering excess */
  padding: 2.2rem 0 1.6rem;
  overflow: hidden;
}

.zodiac-clock {
    position: relative;
    width: var(--clock-size);
    height: var(--clock-size);
    border-radius: 50%;
    border: 2px dashed #e5e7eb;
    background: radial-gradient(circle, #fffaf0 0%, #ffffff 70%);
    margin: 0 auto;
    animation: zodiac-rotate 120s linear infinite;
    transform-origin: center;
    will-change: transform;
}

.center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.center-label-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zodiac-counter 120s linear infinite;
    transform-origin: center;
}

@keyframes zodiac-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes zodiac-counter {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

.center-label .label-title {
    font-weight: 700;
    color: #374151;
}

.center-label .label-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
}

.center-label .node-icon {
    color: var(--wood-orange);
}

.zodiac-node {
    position: absolute;
    width: 70px;
    height: 70px;
    top: 50%;
    left: 50%;
    margin-left: -35px;
    margin-top: -35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--wood-orange);
    transition: all 0.3s ease;
    cursor: pointer;
}

.zodiac-node .node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zodiac-counter 120s linear infinite;
    transform-origin: center;
}

.zodiac-node:hover {
    transform: scale(1.15) !important;
    background: var(--wood-orange);
    color: white;
    z-index: 20;
}

.zodiac-node:hover .node-text,
.zodiac-node:hover .node-sub {
    color: white;
}

.node-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
    line-height: 1;
}

.node-text {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    color: #111827;
}

.node-text span {
    display: block;
    font-size: 0.55rem;
    font-weight: 400;
}

.node-sub {
    font-size: 0.6rem;
    color: #888;
}

.pos-rat { transform: rotate(-90deg) translate(var(--clock-radius)) rotate(90deg); }
.pos-ox { transform: rotate(-60deg) translate(var(--clock-radius)) rotate(60deg); }
.pos-tiger { transform: rotate(-30deg) translate(var(--clock-radius)) rotate(30deg); }
.pos-rabbit { transform: rotate(0deg) translate(var(--clock-radius)) rotate(0deg); }
.pos-dragon { transform: rotate(30deg) translate(var(--clock-radius)) rotate(-30deg); }
.pos-snake { transform: rotate(60deg) translate(var(--clock-radius)) rotate(-60deg); }
.pos-horse { transform: rotate(90deg) translate(var(--clock-radius)) rotate(-90deg); }
.pos-sheep { transform: rotate(120deg) translate(var(--clock-radius)) rotate(-120deg); }
.pos-monkey { transform: rotate(150deg) translate(var(--clock-radius)) rotate(-150deg); }
.pos-rooster { transform: rotate(180deg) translate(var(--clock-radius)) rotate(-180deg); }
.pos-dog { transform: rotate(210deg) translate(var(--clock-radius)) rotate(-210deg); }
.pos-pig { transform: rotate(240deg) translate(var(--clock-radius)) rotate(-240deg); }

.clock-note {
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 1rem;
}

.stem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.stem-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--line-gray, #e5e7eb);
}

.stem-item span {
    font-size: 0.75rem;
    color: #6b7280;
}

.color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.season-card {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid;
}

.season-card h3 {
    font-weight: 700;
    margin: 0 0 8px;
    border-bottom: 1px solid;
    padding-bottom: 6px;
}

.season-entry {
    font-size: 0.85rem;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.season-entry span:last-child {
    color: #6b7280;
    font-style: italic;
}

.measurements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    font-size: 0.9rem;
}

.measurement-card {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 12px;
}

.measurement-card h4 {
    margin: 0 0 8px;
    font-weight: 700;
}

.measurement-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}


/* --- LARGE NUMBERS --- */
.time-measurements-layout .large-numbers-card {
    overflow: hidden;
}

.time-measurements-layout .large-numbers-intro {
    max-width: 760px;
    margin: -0.35rem 0 1.25rem;
    color: #64748b;
    line-height: 1.75;
}

.time-measurements-layout .large-number-scale {
    overflow: hidden;
    border: 1px solid var(--line-gray, #e5e7eb);
    border-radius: 12px;
    background: #ffffff;
}

.time-measurements-layout .large-number-scale-head,
.time-measurements-layout .large-number-row {
    display: grid;
    grid-template-columns: 76px minmax(190px, 1fr) minmax(170px, 0.9fr) minmax(150px, 0.8fr);
    column-gap: 16px;
    align-items: center;
}

.time-measurements-layout .large-number-scale-head {
    padding: 10px 16px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.time-measurements-layout .large-number-row {
    min-height: 54px;
    padding: 9px 16px 9px 13px;
    border-top: 1px solid #eef2f7;
    border-left: 4px solid #94a3b8;
}

.time-measurements-layout .large-number-scale-head + .large-number-row {
    border-top: 0;
}

.time-measurements-layout .large-number-row:hover {
    background: #fffaf0;
}

.time-measurements-layout .large-number-power {
    color: #9a5a13;
    font-size: 0.88rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.time-measurements-layout .large-number-power sup {
    font-size: 0.68em;
}

.time-measurements-layout .large-number-digits {
    overflow-wrap: anywhere;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.time-measurements-layout .large-number-name {
    color: #1f2937;
    font-size: 1rem;
    font-weight: 750;
}

.time-measurements-layout .large-number-equivalent {
    color: #64748b;
    font-size: 0.82rem;
}

.time-measurements-layout .magnitude-band-0 { border-left-color: #94a3b8; }
.time-measurements-layout .magnitude-band-1 { border-left-color: #60a5fa; }
.time-measurements-layout .magnitude-band-2 { border-left-color: #2f9d78; }
.time-measurements-layout .magnitude-band-3 { border-left-color: #d6a52f; }
.time-measurements-layout .magnitude-band-4 { border-left-color: #e07a00; }
.time-measurements-layout .magnitude-band-5 { border-left-color: #c95d74; }
.time-measurements-layout .magnitude-band-6 { border-left-color: #7c6fc2; }

.page-footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

.time-measurements-hero {
    display: grid;
    grid-template-columns: minmax(350px, 1.02fr) minmax(0, 1.18fr);
    gap: 2rem;
    align-items: start;
}

.time-measurements-hero .hub-card {
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .time-measurements-hero {
        grid-template-columns: 1fr;
    }

    .time-measurements-hero .hub-card {
        margin-bottom: 2rem;
    }
}

@media (max-width: 700px) {
    .time-measurements-layout .large-number-scale-head {
        display: none;
    }

    .time-measurements-layout .large-number-row {
        grid-template-columns: 58px minmax(0, 1fr);
        grid-template-areas:
            "power digits"
            "power name"
            "power equivalent";
        gap: 3px 12px;
        min-height: 70px;
        padding: 10px 12px 10px 10px;
    }

    .time-measurements-layout .large-number-power {
        grid-area: power;
        align-self: center;
    }

    .time-measurements-layout .large-number-digits {
        grid-area: digits;
        font-size: 0.75rem;
    }

    .time-measurements-layout .large-number-name {
        grid-area: name;
    }

    .time-measurements-layout .large-number-equivalent {
        grid-area: equivalent;
    }
}

@media (max-width: 500px) {
    :root {
        --clock-size: 300px;
        --clock-radius: 110px;
    }
    .zodiac-node {
        width: 55px;
        height: 55px;
        margin-left: -27.5px;
        margin-top: -27.5px;
    }
    .node-icon { font-size: 1.2rem; }
    .node-text { font-size: 0.6rem; }
    .node-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .zodiac-clock {
        animation: none;
    }

    .center-label-content,
    .zodiac-node .node-content {
        animation: none;
    }
}