/* =========================================================
   yurt-style.css (v7.0 - Refined & Documented)
   Anagura Hub - Radial Yurt Layout with Toono Symbol
   
   RESPONSIVE BREAKPOINTS:
   Mobile:  0px - 767px  (default styles, no media query)
   Desktop: 768px+       (@media (min-width: 768px))
   
   Mobile-first approach: Base styles target mobile,
   desktop styles enhance via min-width media query.
   ========================================================= */

/* --- 1. DESIGN TOKENS (Variables) --- */
:root {
    --wood-orange: #e07a00;
    --wood-dark: #5a3a22;
    --text-dark: #3b2411;
    --text-light: #ffffff;
    --sky-blue: #005a9c;
    
    --accent-novel-deep: #9a3900;
    --radius-small: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Unified Header Variables */
    --header-accent: #e07a00;
    --header-text: #3b2411;
    --header-bg: rgba(255, 255, 255, 0.98);
    --header-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* --- 2. GLOBAL RESET --- */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    padding-top: 70px; /* Offset for fixed header */
    font-family: "Noto Sans JP", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    background: linear-gradient(135deg, #f9f9f9 0%, #f0ebe5 100%);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--wood-orange);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--accent-novel-deep);
}

/* Specific styling for card links */
.hub-card a {
    color: inherit;
    text-decoration: none;
}

.hub-card a:hover {
    color: inherit;
}

/* --- 3. ACCESSIBILITY --- */
.skip-to-content {
    position: absolute;
    top: -50px;
    left: 0;
    background: #132613;
    color: white;
    padding: 8px 16px;
    z-index: 200;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom-right-radius: 8px;
    transition: top 0.3s ease;
}

.skip-to-content:focus { 
    top: 0; 
}

/* --- 4. HEADER STYLES (Unified Anagura Standard) --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--header-bg, rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(8px);
    border-bottom: 3px solid var(--header-accent, #e07a00);
    box-shadow: var(--header-shadow, 0 2px 12px rgba(0, 0, 0, 0.1));
    flex-wrap: nowrap;
    gap: 16px;
}

.site-title {
    order: 1;
    flex-grow: 1;
    text-align: left;
    margin-left: 0;
    min-width: 0;
}

.site-title a {
    color: var(--header-text, #3b2411);
    text-decoration: none;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-family: "Anagura Title", "Noto Serif JP", serif;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-logo-img {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.subtitle {
    order: 3;
    flex-shrink: 0;
    margin: 0;
    color: var(--header-accent, #e07a00);
    font-size: 0.9rem;
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.2;
}

/* --- 5. HUB LAYOUT (MOBILE-FIRST) --- */
.yurt-hub {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0.5rem;
    flex-grow: 1;
    position: relative;
    z-index: 10;
}

.hub-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

/* --- 6. CARD STYLES (MOBILE) --- */
.hub-card {
    display: block;
    background: white;
    padding: 1rem 1.2rem; /* Increased vertical padding */
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    position: relative;
    margin-bottom: 0.6rem; /* Better breathing room */
}

.hub-card:last-child {
    margin-bottom: 0;
}

.hub-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    background-color: #fffaf4;
}

/* Card Typography */
.hub-card h2 {
    margin: 0 0 0.3rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    font-family: "Anagura Title", "Noto Serif JP", serif;
    color: #3b2411; /* Dark brown default */
}

.hub-card h2 a {
    color: inherit; /* Inherit from h2 */
    text-decoration: none;
    transition: color 0.3s ease; /* Add transition */
}

/* Hover state: change h2 color, a inherits it */
.hub-card:hover h2 {
    color: var(--wood-orange);
}

.hub-card p {
    margin: 0;
    font-size: 0.9rem; /* Slightly larger for readability */
    color: #132613;
    line-height: 1.4;
    font-weight: 500;
}

/* Symbol hidden on mobile */
.toono-symbol {
    display: none;
}

/* --- 7. FOOTER STYLES (MUTED DESIGN) --- */
.site-footer {
    background-color: #fafaf8; /* Soft beige */
    color: #5a4943; /* Softer brown */
    border-top: 1px solid #e8e2d8; /* Subtle neutral border */
    padding: 2rem 1rem;
    margin-top: 2rem;
    text-align: center;
    position: relative;
    z-index: 100;
}

.footer-nav {
    display: none; /* Hidden on mobile */
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer-nav a {
    color: #423d37; /* Muted brown links */
    text-decoration: none;
    font-weight: 500; /* Lighter weight */
    font-size: 0.9rem;
    opacity: 0.7; /* More muted */
    position: relative;
    transition: all 0.2s ease;
}

.footer-nav a:hover {
    opacity: 1;
    color: #8b7355; /* Lighter brown on hover */
    text-decoration: underline;
}

.copyright {
    margin: 0;
    color: #6d655a; /* Darker for better contrast */
    font-size: 0.8rem;
    opacity: 0.8; /* Less transparent */
}

/* --- 8. DESKTOP LAYOUT (768px+) --- */
@media (min-width: 768px) {
    
    /* Body adjustments */
    body {
        padding-top: 70px;
    }
    
    /* Header expands */
    .site-header {
        padding: 12px 24px;
    }
    
    .site-logo-img {
        height: 40px; /* Slightly larger on desktop */
    }
    
    /* Hub expands to radial layout */
    .yurt-hub {
        padding: 4rem 1rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Radial Grid */
    .hub-grid {
        --r: 360; /* Radius */
        display: block;
        position: relative;
        width: calc(var(--r) * 2px);
        height: calc(var(--r) * 2px * .7);
        max-width: none;
        padding: 0;
        z-index: 10;
    }
    
    /* Radial Card Positioning */
    .hub-card {
        position: absolute;
        width: 260px;
        max-height: 160px;
        z-index: 10;
        padding: 1.5rem;
        border-radius: var(--radius-small);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        margin-bottom: 0; /* No margin in radial layout */
        
        /* Radial positioning calculation */
        --a2: calc(var(--a) * 1deg - 90deg);
        --x: calc(cos(var(--a2)) * var(--r) * 1px);
        --y: calc(sin(var(--a2)) * var(--r) * 1px * .7);
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) translate(var(--x), var(--y));
    }
    
    .hub-card:hover {
        transform: translate(-50%, -50%) translate(var(--x), var(--y)) translateY(-5px) scale(1.05);
    }
    
    .hub-card h2 {
        margin: 0 0 0.5rem 0;
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    .hub-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Card Positions (6 cards in radial pattern) */
    .hub-grid > .hub-card:nth-child(1) { --a: 0; }
    .hub-grid > .hub-card:nth-child(2) { --a: 60; }
    .hub-grid > .hub-card:nth-child(3) { --a: 120; }
    .hub-grid > .hub-card:nth-child(4) { --a: 180; }
    .hub-grid > .hub-card:nth-child(5) { --a: 240; }
    .hub-grid > .hub-card:nth-child(6) { --a: 300; }
    
    /* Toono Symbol (Desktop Only) */
    .toono-symbol {
        display: flex;
        z-index: 1; /* Behind the cards */
        pointer-events: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        justify-content: center;
        align-items: center;
    }

/* Toono Symbol (Desktop Only) */
.toono-symbol {
    display: flex;
    z-index: 1; /* Behind the cards */
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

    .toono-symbol img {
        /* Responsive sizing: scales with viewport */
        width: max(180vmax, 1800px); /* Never smaller than 1800px */
        height: max(180vmax, 1800px);
        max-width: none;
        display: block;
        animation: fadeIn 1s ease-out;
        transform: translateY(-20px);
    }

    /* Fine-tune for different screen sizes */
    @media (min-width: 768px) and (max-width: 1024px) {
        /* Tablet/small desktop: ensure full coverage */
        .toono-symbol img {
            width: max(200vmax, 2000px);
            height: max(200vmax, 2000px);
        }
    }

    @media (min-width: 1025px) and (max-width: 1440px) {
        /* Medium desktop: balanced size */
        .toono-symbol img {
            width: max(180vmax, 2200px);
            height: max(180vmax, 2200px);
        }
    }

    @media (min-width: 1441px) {
        /* Large desktop: extra coverage */
        .toono-symbol img {
            width: max(150vmax, 2400px);
            height: max(150vmax, 2400px);
        }
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Footer expands */
    .site-footer {
        padding: 2rem 2rem;
    }
    
    .footer-nav {
        display: block; /* Show on desktop */
    }
}

/* --- 9. MOBILE REFINEMENTS (480px and below) --- */
@media (max-width: 480px) {
    .subtitle {
        display: none; /* Hide subtitle on very small screens */
    }
    
    .site-title a {
        font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    }
    
    .site-logo-img {
        height: 28px; /* Smaller logo on mobile */
    }
}

/* --- 10. UTILITY CLASSES --- */
.section-divider { 
    display: none; 
}

/* --- 11. PRINT STYLES --- */
@media print {
    .site-header,
    .toono-symbol,
    .site-footer {
        display: none;
    }
    
    body {
        padding-top: 0;
        background: white;
    }
    
    .hub-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}