/* =====================================================
   Tales of Lestanh · Component Styles
   Extra components (video embed, gallery, etc.)
   ===================================================== */

/* ─── Video Embed ─── */
.video-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: 8px; overflow: hidden; border: var(--border-gold); box-shadow: var(--shadow-card); background: #000; }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ─── Image Gallery ─── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.gallery-item { position: relative; overflow: hidden; border-radius: 6px; cursor: pointer; border: var(--border-gold); aspect-ratio: 4/3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .3s; }
.gallery-item:hover img { transform: scale(1.08); opacity: .85; }
.gallery-item-overlay { position: absolute; inset: 0; background: rgba(10,7,3,.5); opacity: 0; transition: opacity .3s; display: flex; align-items: center; justify-content: center; }
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-overlay span { font-size: 1.8rem; color: var(--gold-light); }

/* ─── Lightbox ─── */
#lightbox { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; }
#lightbox.active { display: flex; }
#lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border: 1px solid rgba(201,160,62,.3); border-radius: 4px; }
#lightboxClose { position: absolute; top: 24px; right: 32px; font-size: 2rem; color: var(--gold); cursor: pointer; background: none; border: none; transition: transform .2s; }
#lightboxClose:hover { transform: rotate(90deg); }

/* ─── Stat Bars ─── */
.stat-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.stat-label { font-family: var(--font-heading); font-size: .78rem; color: var(--text-mid); min-width: 80px; letter-spacing: .08em; }
.stat-bar-wrap { flex: 1; height: 6px; background: rgba(201,160,62,.12); border-radius: 3px; overflow: hidden; }
.stat-bar { height: 100%; background: linear-gradient(to right, var(--gold-dark), var(--gold-light)); border-radius: 3px; transition: width 1.2s cubic-bezier(.25,.46,.45,.94); width: 0; }
.stat-val { font-family: var(--font-heading); font-size: .78rem; color: var(--gold); min-width: 30px; text-align: right; }

/* ─── Info Box ─── */
.info-box { padding: 22px 26px; background: rgba(201,160,62,.07); border: 1px solid rgba(201,160,62,.32); border-radius: 6px; border-left: 3px solid var(--gold); margin-bottom: 22px; }
.info-box-title { font-family: var(--font-heading); font-size: .85rem; color: var(--gold-dark); margin-bottom: 8px; letter-spacing: .1em; }
.info-box p { font-size: .88rem; color: var(--text-mid); margin: 0; line-height: 1.8; }

/* ─── Table ─── */
.styled-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.styled-table th { font-family: var(--font-heading); font-size: .75rem; letter-spacing: .14em; color: var(--gold); text-align: left; padding: 12px 18px; background: rgba(201,160,62,.08); border-bottom: 2px solid rgba(201,160,62,.3); }
.styled-table td { padding: 12px 18px; color: var(--text-mid); border-bottom: 1px solid rgba(201,160,62,.12); }
.styled-table tr:hover td { background: rgba(201,160,62,.04); color: var(--text-dark); }

/* ─── Breadcrumb ─── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-family: var(--font-serif); font-size: .8rem; color: var(--text-light); margin-bottom: 24px; }
.breadcrumb a { color: var(--gold-dark); transition: color .2s; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-sep { color: rgba(201,160,62,.4); font-size: .7rem; }

/* ─── Back-to-top ─── */
#backToTop { position: fixed; bottom: 28px; right: 28px; width: 44px; height: 44px; background: rgba(16,10,5,.85); border: 1px solid rgba(201,160,62,.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.1rem; color: var(--gold); transition: all .3s; opacity: 0; visibility: hidden; backdrop-filter: blur(8px); z-index: 500; }
#backToTop.visible { opacity: 1; visibility: visible; }
#backToTop:hover { background: rgba(201,160,62,.2); transform: translateY(-3px); }

/* ─── Timeline ─── */
.timeline { position: relative; padding: 0 0 0 40px; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, transparent, var(--gold) 5%, var(--gold) 95%, transparent); }
.timeline-era { margin-bottom: 48px; }
.timeline-era-header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.timeline-era-name { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold-dark); }
.timeline-era-period { font-family: var(--font-serif); font-size: .82rem; color: var(--text-light); }
.timeline-events { display: flex; flex-direction: column; gap: 16px; }
.timeline-event { position: relative; padding: 18px 22px; background: var(--bg-card); border: var(--border-gold); border-radius: 6px; box-shadow: var(--shadow-card); }
.timeline-event::before { content: '◆'; position: absolute; left: -46px; top: 20px; color: var(--gold); font-size: .65rem; }
.timeline-event-year { font-family: var(--font-heading); font-size: .75rem; letter-spacing: .15em; color: var(--gold); margin-bottom: 6px; }
.timeline-event-content h4 { font-family: var(--font-display); font-size: 1.05rem; color: var(--text-dark); margin-bottom: 6px; }
.timeline-event-content p { font-size: .88rem; color: var(--text-mid); line-height: 1.8; margin: 0; }

/* ─── Calendar Grid ─── */
.calendar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 20px 0 44px; }
.month-card { position: relative; padding: 22px 20px; background: var(--bg-card); border: var(--border-gold); border-radius: 6px; box-shadow: var(--shadow-card); overflow: hidden; }
.month-num { position: absolute; top: 12px; right: 16px; font-size: 3.5rem; font-family: var(--font-heading); font-weight: 700; color: rgba(201,160,62,.1); line-height: 1; }
.month-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--text-dark); margin-bottom: 4px; }
.month-season { font-family: var(--font-serif); font-size: .78rem; margin-bottom: 12px; }
.month-desc { font-size: .86rem; color: var(--text-mid); line-height: 1.8; margin: 0; }

/* ─── Magic System ─── */
.magic-category { padding: 28px 30px; background: var(--bg-card); border: var(--border-gold); border-left: 4px solid var(--gold); border-radius: 6px; box-shadow: var(--shadow-card); margin-bottom: 36px; }
.magic-category-name { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold-dark); margin-bottom: 10px; }
.magic-category-desc { font-size: .9rem; color: var(--text-mid); line-height: 1.85; margin-bottom: 0; }
.magic-sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; margin-top: 16px; }
.magic-sub { padding: 14px 16px; background: rgba(201,160,62,.05); border: 1px solid rgba(201,160,62,.2); border-radius: 5px; }
.magic-sub-name { font-family: var(--font-heading); font-size: .9rem; color: var(--text-dark); margin-bottom: 5px; }
.magic-sub-desc { font-size: .8rem; color: var(--text-mid); line-height: 1.7; }

/* ─── Org Card ─── */
.org-card { padding: 22px 26px; background: var(--bg-card); border: var(--border-gold); border-left: 3px solid var(--gold); border-radius: 6px; box-shadow: var(--shadow-card); margin-bottom: 18px; }
.org-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--text-dark); margin-bottom: 4px; }
.org-type { font-family: var(--font-serif); font-size: .78rem; color: var(--gold-dark); margin-bottom: 10px; }
.org-desc { font-size: .88rem; color: var(--text-mid); line-height: 1.85; margin: 0; }

/* ─── Bestiary Grid ─── */
.bestiary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 22px; margin: 20px 0 44px; }
.beast-card { background: var(--bg-card); border: var(--border-gold); border-radius: 8px; box-shadow: var(--shadow-card); overflow: hidden; }
.beast-img-wrap { position: relative; height: 200px; background: rgba(20,15,8,.6); }
.beast-img { width: 100%; height: 100%; object-fit: cover; }
.beast-danger-badge { position: absolute; top: 12px; right: 12px; font-family: var(--font-heading); font-size: .72rem; padding: 3px 10px; border-radius: 3px; color: #fff; letter-spacing: .1em; }
.beast-body { padding: 20px 22px; }
.beast-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--text-dark); margin-bottom: 4px; }
.beast-type { font-family: var(--font-serif); font-size: .78rem; color: var(--gold-dark); margin-bottom: 10px; }
.beast-desc { font-size: .85rem; color: var(--text-mid); line-height: 1.8; margin: 0 0 12px; }

/* ─── Currency Cards ─── */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 16px; }
.currency-card { padding: 20px 16px; background: var(--bg-card); border: var(--border-gold); border-radius: 6px; box-shadow: var(--shadow-card); text-align: center; }
.currency-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.currency-name { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-dark); margin-bottom: 2px; }
.currency-value { font-family: var(--font-serif); font-size: .75rem; color: var(--gold); margin-bottom: 8px; }
.currency-desc { font-size: .78rem; color: var(--text-mid); line-height: 1.7; margin: 0; }

/* ─── Rank Badge ─── */
.rank-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 8px 12px; border-radius: 4px; font-family: var(--font-heading); font-size: .9rem; font-weight: 700; letter-spacing: .1em; flex-shrink: 0; }
.rank-s { background: rgba(201,160,62,.15); color: var(--gold); border: 1px solid var(--gold); }
.rank-a { background: rgba(138,100,200,.15); color: #B090D8; border: 1px solid rgba(138,100,200,.5); }
.rank-b { background: rgba(60,120,200,.15); color: #7090D0; border: 1px solid rgba(60,120,200,.5); }
.rank-c { background: rgba(80,160,80,.15); color: #80B880; border: 1px solid rgba(80,160,80,.5); }
.rank-d { background: rgba(140,140,140,.12); color: #A0A0A0; border: 1px solid rgba(140,140,140,.35); }

/* ─── narrow page container ─── */
.narrow { max-width: 800px; }

/* ─── Misc site enhancements ─── */
.teal { color: var(--teal); }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: var(--dark); font-family: var(--font-heading); font-size: .85rem; letter-spacing: .12em; border-radius: 4px; text-decoration: none; transition: all .3s; box-shadow: 0 4px 16px rgba(201,160,62,.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,160,62,.35); }

