/* =============================================================================
   home.css — Authenticated home dashboard (culvert chart, char card, mules)
   Depends on: paws.css (design tokens), profile.css
   Sections:
     1. Header row + quick links
     2. Two-column layout
     3. Home cards (culvert, mules)
     4. Character card (right column)
     5. Mobile responsive
   ============================================================================= */

/* ── 1. Header row + quick links ─────────────────────────────────── */

.home-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1.5rem;
}
.home-header-row h2 { margin: 0; }
.home-subtitle {
    margin: 0.2em 0 0;
    opacity: 0.6;
    font-size: 0.88em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.home-birthday {
    font-size: 0.82rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.4em;
    white-space: nowrap;
    opacity: 0.75;
}
.home-birthday-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15em;
    flex-shrink: 0;
}
.home-zodiac {
    font-size: 0.78rem;
    color: var(--color-text);
    opacity: 0.6;
    text-align: right;
    white-space: nowrap;
}

/* -- Quick links ----------------------------------------------------------- */
.home-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}
.home-quick-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.82rem;
    padding: 0.32em 0.85em;
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    transition: background 0.15s, border-color 0.15s;
}
.home-quick-links a:hover {
    background: var(--color-input-bg);
    border-color: var(--color-border);
    text-decoration: none;
}
.home-quick-links i { opacity: 0.65; }

.home-layout {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 1.5rem;
    align-items: stretch; 
}
.home-left {
    min-width: 0; 
}

.home-card {
    background: var(--color-surface); 
    border: 1px solid var(--color-border);
    color: var(--color-text);
    box-shadow: 0 1px 0 var(--color-surface-shadow);
    border-radius: 0.65rem;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
}

.home-card-header h3,
.home-char-name {
    color: var(--color-text-strong);
}

.home-card-link {
    color: var(--color-nav-text-active);
    opacity: 0.95;
}

.home-subtitle {
    color: var(--color-text-muted);
    opacity: 0.95;
}

.home-culvert-placeholder-icon {
    opacity: 0.45;
    color: var(--color-text-muted);
}

.home-card:last-child { margin-bottom: 0; }
.home-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.4em;
}
.home-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}
.home-card-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.home-card-link:hover { opacity: 1; text-decoration: none; }

/* -- Right column: character card -------------------------------------------------- */
.home-right {
    display: flex;
    flex-direction: column;
}
.home-char-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 3.2rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
    flex: 1; 
    justify-content: center;
    color: var(--color-text);
    box-shadow: 0 1px 0 var(--color-surface-shadow);
    position: relative;
}
.home-char-loading {
    opacity: 0.35;
    font-size: 1.1rem;
}
.home-char-portrait {
    width: 130px;
    height: auto;
    display: block;
    margin: 0 auto 0.35rem;
}
.home-char-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 0.1rem;
    word-break: break-word;
}
.home-char-level {
    font-size: 0.85rem;
    opacity: 0.7;
}
.home-char-job {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.5;
    margin-bottom: 0.3rem;
}
.home-char-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
    align-self: flex-start;
    position: absolute;
    top: 0.6rem;
    left: 0;
    right: 0;
    padding: 0 1rem;
    box-sizing: border-box;
    overflow: hidden;
}
.home-char-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0;
}
.home-char-action-btn {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 0.35rem;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.45rem;
    line-height: 1;
    transition: color 0.12s, border-color 0.12s;
}
.home-char-action-btn:hover { color: var(--color-text); border-color: var(--color-text-muted); }
.home-char-stat-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1rem 0.6rem;
    width: 100%;
    margin-top: 0.4rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.5rem;
    text-align: left;
}
.home-char-stat-label {
    font-size: 0.72rem;
    opacity: 0.45;
    white-space: nowrap;
}
.home-char-stat-value {
    font-size: 0.72rem;
    opacity: 0.75;
    font-weight: 500;
}
/* Mule chips on left column */
.home-mule-chip-group {
    margin-bottom: 0.45rem;
}
.home-mule-chip-guild {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.45;
    margin-bottom: 0.2rem;
}
.home-char-unavailable {
    font-size: 0.8rem;
    opacity: 0.5;
    margin: 0;
}
.home-char-stale {
    font-size: 0.7rem;
    opacity: 0.45;
    margin: 0.35rem 0 0;
}
@media (max-width: 768px) {
    .home-char-card {
        padding: 1rem;
        text-align: center;
    }
    .home-char-unavailable,
    .home-char-stale {
        text-align: center;
        width: 100%;
    }
}

/* -- Mule list ----------------------------------------------------------- */
.home-mule-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.5;
    margin: 0 0 0.5rem;
    font-weight: 600;
}
/* -- Culvert mini chart ------------------------------------------- */
.home-culvert-chart-wrap {
    position: relative;
    height: 200px;
    width: 100%;
}

.home-culvert-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    padding: 2.5em 1em;
    text-align: center;
    opacity: 0.75;
}
.home-culvert-placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.25;
    display: block;
}
.home-culvert-placeholder p { margin: 0; font-size: 0.95em; }
.home-culvert-add-btn.button.primary {
    font-size: 0.78rem;
    padding: 0.3em 0.9em;
}

@media (max-width: 760px) {
    .home-layout {
        grid-template-columns: 1fr;
    }
    /* Stack left column cards so mules appear above culvert on mobile
       and normalize spacing using gap so public profile matches home. */
    .home-left {
        display: flex !important;
        flex-direction: column;
        gap: 1.5rem; /* match .home-layout gap */
    }
    /* Remove per-card margin-bottom in the stacked container (gap handles spacing).
       Use explicit order so mules always appear before culvert when stacked. */
    .home-left > .home-card { margin-bottom: 0; }
    .home-card--mules {
        order: -1;
    }
    .home-right {
        position: static;
        order: -1; 
    }
    .home-char-card {
        flex-direction: column;
        text-align: center;
        gap: 0.35rem;
        padding: 1rem;
        justify-content: center;
        align-items: center;
    }
    .home-char-header-row {
        position: static;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0; /* flush on mobile */
        box-sizing: border-box;
        margin-bottom: 0.5rem;
    }
    .home-char-portrait { margin: 0 auto; width: 80px; height: auto; }
}
@media (max-width: 500px) {
    /* Let name/guild div shrink so the birthday block stays anchored to the right. */
    .home-header-row > div:first-child { flex: 1; min-width: 0; }
    .home-quick-links { width: 100%; }
}

/* =============================================================================
   Landing page (unauthenticated)
   ============================================================================= */
#main > .panel.intro .image.object {
    flex: 0 0 11rem;
    width: 11rem;
}
#main > .panel.intro .image.object img {
    max-height: 10rem;
}

@media (max-width: 720px) {
    #main > .panel.intro .image.object { display: none; }
}
