/* ============================================================
   DESCRIPTIONS PAGE — Clean UI + Physical Calendar
   ============================================================ */

/* --- Hero --- */
.desc-hero {
    background: #fffaf3;
    padding: 80px 24px 0;
    position: relative;
    overflow: hidden;
    min-height: 520px;
}

.desc-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    max-width: 1100px;
    margin: 0 auto;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.desc-art-col {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-left: -40px;
    overflow: hidden;
    max-height: 480px;
    border-radius: 16px;
    padding-top: 10%;
}

.desc-hero-art {
    width: 100%;
    max-width: 420px;
    object-fit: cover;
    object-position: top center;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.12));
    transition: opacity 0.5s var(--ease-out-expo);
    transform: scale(1.25);
    transform-origin: top center;
}

.desc-info-col {
    padding: 20px 0;
}

/* --- Character tabs --- */
.char-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.char-tab {
    padding: 8px 20px;
    border: 2px solid var(--gray-300);
    border-radius: 24px;
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}
.char-tab:hover { border-color: var(--accent); color: var(--accent); }
.char-tab.active { background: var(--accent); border-color: var(--accent); color: var(--white); }

.desc-name-zh {
    display: block;
    font-size: 16px;
    color: var(--gray-400);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.desc-name {
    font-family: var(--font-heading);
    font-size: clamp(52px, 7vw, 88px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.desc-role {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
}

.desc-bio {
    font-size: 17px;
    line-height: 1.8;
    color: var(--gray-500);
    max-width: 460px;
    white-space: pre-line;
}

/* --- Crime tape positions --- */
.desc-hero .crime-tape-tl {
    top: 100px;
    left: -10%;
    width: 120%;
    transform: rotate(-6deg);
}
.desc-hero .crime-tape-left {
    top: -10%;
    left: 24px;
    width: 120%;
    transform-origin: top left;
    transform: rotate(80deg);
}

/* --- Sections --- */
.desc-section { padding: 80px 24px; }
.desc-profile { background: #f7f4f0; }
.desc-schedule { background: #fffaf3; }

.desc-container { max-width: 1000px; margin: 0 auto; }

.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 400;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.section-sub {
    font-size: 16px;
    color: var(--gray-400);
    margin-bottom: 40px;
}

/* --- Profile cards --- */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 60px;
}

.profile-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 28px;
    transition: box-shadow 0.3s var(--ease-out-expo);
}
.profile-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.06); }
.profile-card-full { grid-column: 1 / -1; }

.profile-card-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 400;
    color: var(--gray-700);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(209, 96, 31, 0.15);
}

.profile-card-text {
    font-size: 15px;
    line-height: 1.75;
    color: var(--gray-500);
    white-space: pre-line;
}

/* --- Relationships --- */
.relationships-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.rel-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 24px;
    transition: all 0.3s var(--ease-out-expo);
}
.rel-card:hover { border-color: rgba(209, 96, 31, 0.2); box-shadow: 0 8px 30px rgba(0,0,0,0.05); }

.rel-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 400;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.rel-style {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    display: block;
}

.rel-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-500);
}

/* ============================================================
   PHYSICAL CALENDAR — side by side with schedule
   ============================================================ */
.schedule-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.calendar {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 50px rgba(0,0,0,0.08);
    border: 1px solid var(--gray-200);
    perspective: 800px;
}

/* --- Calendar header (month bar) --- */
.calendar-header {
    background: var(--crimson);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.cal-month {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.cal-nav {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.cal-nav:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.6); }
.cal-nav svg { width: 18px; height: 18px; }

/* --- Weekday row --- */
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f9f5ef;
    border-bottom: 1px solid var(--gray-200);
}

.cal-weekdays span {
    text-align: center;
    padding: 10px 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
}

/* --- Day grid with page flip wrapper --- */
.cal-grid-wrap {
    position: relative;
    overflow: hidden;
    perspective: 800px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    transform-origin: top center;
    backface-visibility: hidden;
}

/* Calendar page flip — hinged from top like a wall calendar */
.cal-grid.flip-up {
    animation: cal-page-up 0.35s ease-in forwards;
}
.cal-grid.flip-down {
    animation: cal-page-down 0.4s var(--ease-out-expo) forwards;
}

@keyframes cal-page-up {
    0%   { transform: rotateX(0deg); opacity: 1; }
    60%  { opacity: 0.4; }
    100% { transform: rotateX(-120deg); opacity: 0; }
}
@keyframes cal-page-down {
    0%   { transform: rotateX(90deg); opacity: 0; }
    40%  { opacity: 0.6; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

.cal-cell {
    border-right: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s var(--ease-out-expo);
    cursor: default;
    height: 52px;
}
.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell-num {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--gray-300);
    line-height: 1;
}

/* Cells with schedule data */
.cal-cell.has-data { cursor: pointer; }
.cal-cell.has-data .cal-cell-num { color: var(--gray-700); }
.cal-cell.has-data:hover { background: rgba(209, 96, 31, 0.06); }

/* Schedule indicator dot */
.cal-cell.has-data::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* Active / selected */
.cal-cell.active { background: var(--accent); }
.cal-cell.active .cal-cell-num { color: var(--white); }
.cal-cell.active::after { background: var(--white); }

/* Empty cells */
.cal-cell.empty { background: #faf8f4; }
.cal-cell.empty .cal-cell-num { color: var(--gray-200); }

/* Weekend columns */
.cal-cell.weekend .cal-cell-num { color: var(--gray-400); }
.cal-cell.weekend.has-data .cal-cell-num { color: var(--crimson); }
.cal-cell.active.weekend .cal-cell-num { color: var(--white); }

/* Today indicator */
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--gold); }

/* --- Schedule panel (right side) --- */
.schedule-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 50px rgba(0,0,0,0.08);
    min-height: 380px;
    position: sticky;
    top: 80px;
}

.schedule-panel-header {
    background: linear-gradient(135deg, var(--accent), #c85218);
    color: var(--white);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.schedule-panel-date {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 400;
}

.schedule-panel-nav {
    display: flex;
    gap: 6px;
}

.sched-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}
.sched-nav-btn:hover { background: rgba(255,255,255,0.15); }

.schedule-panel-body {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

.schedule-panel-empty {
    color: var(--gray-400);
    font-style: italic;
    text-align: center;
    padding: 60px 20px;
    font-size: 15px;
}

.schedule-panel .day-periods {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.schedule-panel .day-period {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}
.schedule-panel .day-period:last-child { border-bottom: none; }

.period-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-top: 2px;
}

.period-morning  .period-label { color: #f59e0b; }
.period-noon     .period-label { color: #f97316; }
.period-afternoon .period-label { color: #6366f1; }
.period-evening  .period-label { color: #8b5cf6; }
.period-night    .period-label { color: #1e3a5f; }

.period-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-600);
    white-space: pre-line;
}

/* Fade in animation for schedule content */
@keyframes sched-fade {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}
.schedule-panel-body.animate .day-period {
    animation: sched-fade 0.35s var(--ease-out-expo) both;
}
.schedule-panel-body.animate .day-period:nth-child(2) { animation-delay: 0.05s; }
.schedule-panel-body.animate .day-period:nth-child(3) { animation-delay: 0.10s; }
.schedule-panel-body.animate .day-period:nth-child(4) { animation-delay: 0.15s; }
.schedule-panel-body.animate .day-period:nth-child(5) { animation-delay: 0.20s; }

/* old expanded day view removed — schedule panel replaces it */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .desc-hero-inner { grid-template-columns: 1fr; text-align: center; }
    .desc-art-col { margin-left: 0; }
    .desc-hero-art { max-height: 300px; }
    .desc-bio { max-width: 100%; }
    .profile-grid { grid-template-columns: 1fr; }
    .relationships-grid { grid-template-columns: 1fr; }
    .schedule-layout { grid-template-columns: 1fr; }
    .schedule-panel { position: static; }
    .cal-cell { height: 44px; }
    .desc-art-col { margin-left: 0; }
    .desc-hero-art { max-height: 320px; }
    .cal-cell-num { font-size: 16px; }
    .schedule-panel .day-period { grid-template-columns: 1fr; }
    .desc-hero .crime-tape-left { display: none; }
}
