/* Verenga Africa - additions (nav, hero books, audiobooks, shared bits).
   Uses the tokens from main.css: black / white / soft-grey, hairline --line borders, 2px corners, teal --accent. */

/* ---- accessibility ---- */
.skip-link { position: absolute; left: -999px; top: 0; z-index: 3000; background: var(--accent); color: #fff; padding: .75rem 1.25rem; font-weight: 600; }
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shared top navigation (includes/nav.php) ---- */
.vg-nav { background: #000; border-bottom: 1px solid rgba(255,255,255,.06); position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 1rem 0; }
.vg-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.vg-nav-brand { display: flex; align-items: center; }
.vg-nav-brand img { height: 36px; width: auto; display: block; }
.vg-nav-links { display: flex; align-items: center; gap: 1.75rem; }
.vg-nav-link { color: rgba(255,255,255,.7); font-weight: 500; font-size: .875rem; letter-spacing: -.01em; text-decoration: none; transition: color .2s; }
.vg-nav-link:hover, .vg-nav-link.is-active { color: #fff; }
.vg-dash-btn { display: inline-flex; align-items: center; gap: .5rem; background: #fff; color: #000; border-radius: 999px; padding: .55rem 1.1rem; font-weight: 700; font-size: .8125rem; letter-spacing: -.01em; text-decoration: none; box-shadow: 0 8px 20px rgba(255,255,255,.12); transition: transform .2s, background .2s; white-space: nowrap; }
.vg-dash-btn:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.vg-user { position: relative; }
.vg-user-btn { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.15); padding: .5rem 1rem; font-size: .8125rem; border-radius: 8px; cursor: pointer; font-weight: 500; display: flex; align-items: center; gap: .5rem; }
.vg-user-btn:hover { background: rgba(255,255,255,.16); }
.vg-btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2); padding: .5rem 1.125rem; font-size: .8125rem; border-radius: 8px; font-weight: 500; text-decoration: none; }
.vg-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.vg-btn-solid { background: #fff; color: #000; padding: .5rem 1.125rem; font-size: .8125rem; border-radius: 8px; font-weight: 500; text-decoration: none; }
.vg-btn-solid:hover { background: #e7e7e4; color: #000; }
.vg-nav-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.2); width: 44px; height: 44px; border-radius: 8px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.vg-nav-toggle span { display: block; width: 20px; height: 2px; background: #fff; transition: transform .2s, opacity .2s; }
.vg-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.vg-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.vg-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.vg-nav .dropdown-menu { right: 0; left: auto; min-width: 210px; }

@media (max-width: 860px) {
    .vg-nav { padding: .7rem 0; }
    .vg-nav-toggle { display: inline-flex; }
    .vg-nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #000; border-bottom: 1px solid rgba(255,255,255,.1);
        flex-direction: column; align-items: stretch; gap: 0; padding: .75rem 1.25rem 1.25rem; max-height: calc(100vh - 70px); overflow-y: auto; }
    .vg-nav-links.is-open { display: flex; }
    .vg-nav-link { padding: .9rem 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 1rem; }
    .vg-dash-btn, .vg-btn-ghost, .vg-btn-solid { justify-content: center; text-align: center; margin-top: .75rem; padding: .85rem 1rem; }
    .vg-user { margin-top: .75rem; }
    .vg-user-btn { width: 100%; justify-content: space-between; padding: .85rem 1rem; }
    .vg-nav .dropdown-menu { position: static; width: 100%; margin-top: .5rem; box-shadow: none; }
}

/* ---- homepage hero: newest books ---- */
.vg-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(0,139,116,.7); animation: vgPulse 2s infinite; }
@keyframes vgPulse { 70% { box-shadow: 0 0 0 9px rgba(0,139,116,0); } 100% { box-shadow: 0 0 0 0 rgba(0,139,116,0); } }
.vg-hero-book { position: relative; aspect-ratio: 2/3; overflow: hidden; border: 1px solid rgba(255,255,255,.08); display: block; background: linear-gradient(160deg, var(--c1, #1f2a2a), var(--c2, #0b0f0f)); transition: transform .3s, border-color .3s; }
.vg-hero-book:hover { transform: translateY(-8px); border-color: rgba(255,255,255,.25); }
.vg-hero-book img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25) brightness(.9); }
.vg-hero-book-title { position: absolute; left: 1rem; right: 1rem; top: 1.1rem; font-family: 'Crimson Pro', Georgia, serif; font-weight: 700; font-size: 1.15rem; line-height: 1.15; color: rgba(255,255,255,.92); }
.vg-hero-book img ~ .vg-hero-book-title { display: none; }   /* real cover already shows its title */
.vg-hero-book::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.75) 100%); pointer-events: none; }
.vg-hero-book-meta { position: absolute; inset: auto 0 0 0; padding: 1rem; z-index: 1; }
.vg-hero-book-kicker { font-size: .68rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .25rem; font-weight: 600; filter: brightness(1.6); }
.vg-hero-book-name { font-weight: 600; color: #fff; font-size: .86rem; line-height: 1.3; }
.vg-hero-book-by { font-size: .74rem; color: rgba(255,255,255,.6); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vg-hero-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; text-align: center; padding: 1rem; color: rgba(255,255,255,.55); background: transparent; border: 1px dashed rgba(255,255,255,.2); font-size: .8rem; }
.vg-hero-empty::after { display: none; }
.vg-hero-empty i { font-size: 1.25rem; }
.vg-hero-empty:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.vg-hero-cta:hover { background: var(--accent-hover) !important; }

/* ---- audiobook cards ---- */
.vg-audio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.5rem; }
.vg-audio-card { display: block; color: inherit; text-decoration: none; transition: transform .25s; }
.vg-audio-card:hover { transform: translateY(-6px); color: inherit; }
.vg-audio-cover { aspect-ratio: 1/1; position: relative; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(160deg, var(--c1, #1f2a2a), var(--c2, #0b0f0f)); display: flex; align-items: flex-end; padding: .9rem; color: #fff; }
.vg-audio-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vg-audio-cover-title { position: relative; font-family: 'Crimson Pro', Georgia, serif; font-weight: 700; font-size: 1.15rem; line-height: 1.15; max-width: 80%; }
.vg-audio-dur { position: absolute; left: .6rem; top: .6rem; background: rgba(0,0,0,.7); color: #fff; font-size: .7rem; font-weight: 600; padding: .2rem .5rem; }
.vg-audio-play { position: absolute; right: .7rem; bottom: .7rem; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #000; display: flex; align-items: center; justify-content: center; font-size: .85rem; transition: background .2s, color .2s; }
.vg-audio-play i { margin-left: 2px; }
.vg-audio-card:hover .vg-audio-play { background: var(--accent); color: #fff; }
.vg-audio-card h3 { font-size: .95rem; margin: .8rem 0 .15rem; letter-spacing: -.01em; font-weight: 600; }
.vg-audio-card p { font-size: .8rem; color: var(--muted); margin: 0; }

/* ---- shared small components used by the new pages ---- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; font-size: .75rem; font-weight: 600; background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.pill.green { background: var(--success-50); color: var(--success); border-color: transparent; }
.pill.amber { background: var(--warning-50); color: var(--warning); border-color: transparent; }
.pill.red { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.pill.gray { background: var(--soft); color: var(--muted); }
.pill.accent { background: var(--accent-50); color: var(--accent); border-color: transparent; }
.vg-empty, .empty-state { text-align: center; padding: 3rem 1.5rem; border: 1px dashed var(--line-strong); background: #fff; color: var(--muted); }
.empty-state i { font-size: 2rem; margin-bottom: 1rem; display: block; color: var(--line-strong); }
/* top/bottom only: the shorthand used to zero .container's 24px side padding, so content touched the screen edges */
.vg-page { padding-top: 2.5rem; padding-bottom: 4rem; }
.vg-page h1 { font-size: 2.25rem; letter-spacing: -.03em; }
img { max-width: 100%; }
.alert-error { background: var(--danger-50); color: var(--danger); border: 1px solid var(--danger-200, rgba(217,45,32,.25)); }
@media (max-width: 768px) { .vg-page h1 { font-size: 1.75rem; } }

/* Make the hidden attribute win over component display rules (install links, banners) */
[hidden] { display: none !important; }

/* ================= Homepage layout (replaces the old inline grids) ================= */
.vg-home-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 80px; align-items: start; margin-bottom: 120px; }
.vg-hero-books { position: relative; margin-top: 60px; }
.vg-hero-books-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vg-cat-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; background: rgba(255,255,255,0.04); }
.vg-g2 { display: grid; grid-template-columns: 1fr 1fr; }
.vg-g3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.vg-g4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.vg-g6 { display: grid; grid-template-columns: repeat(6, 1fr); }
.vg-home-h1 { line-height: 1.05; }

.vg-home-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.vg-home-post { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.vg-home-post:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.vg-home-post img, .vg-home-post-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.vg-home-post-ph { display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--accent); font-size: 2rem; }
.vg-home-post-body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.vg-home-post-body h3 { font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.25; margin: 0; color: var(--black); }
.vg-home-post-body p { color: var(--gray-600); font-size: .9rem; margin: 0; }
.vg-home-post-body span { margin-top: auto; padding-top: .5rem; font-size: .8rem; color: var(--muted); }

@media (max-width: 1100px) {
    .vg-home-split { gap: 48px; margin-bottom: 80px; }
    .vg-g2 { gap: 4rem !important; }
    .vg-g4 { grid-template-columns: repeat(2, 1fr); gap: 2.5rem !important; }
    .vg-g6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .vg-home-hero { padding: 96px 0 56px !important; min-height: 0 !important; }
    .vg-home-split { grid-template-columns: 1fr; gap: 40px; margin-bottom: 56px; }
    .vg-hero-books { margin-top: 0; max-width: 460px; }
    .vg-cat { grid-column: 1 / -1 !important; padding: 32px 24px !important; }
    .vg-cat-grid { grid-template-columns: 1fr; }
    .vg-g2 { grid-template-columns: 1fr; gap: 2.5rem !important; }
    .vg-g3 { grid-template-columns: 1fr; }
    .vg-home-posts { grid-template-columns: 1fr; }
    .vg-home-hero a[href] { max-width: 100%; }
}
@media (max-width: 560px) {
    .vg-g4 { grid-template-columns: 1fr; }
    .vg-g6 { grid-template-columns: repeat(2, 1fr); gap: 16px !important; }
    .vg-home-hero a { padding-left: 24px !important; padding-right: 24px !important; }
}
@media (max-width: 860px) { .vg-home-sec { padding: 4.5rem 0 !important; } }

/* read-along + data saver */
.vg-ra { max-height: 340px; overflow-y: auto; margin-top: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.vg-ra-p { padding: .35rem .5rem; margin: 0 0 .4rem; border-radius: 6px; cursor: pointer; line-height: 1.65; transition: background .2s; }
.vg-ra-p:hover { background: rgba(0,139,116,.08); }
.vg-ra-p.on { background: rgba(0,139,116,.18); box-shadow: inset 3px 0 0 var(--accent); }
.vg-save-data .page-hero, .vg-save-data [style*="background-image"] { background-image: none !important; }
.vg-save-data .vg-hero-book img { display: none; }

@media (max-width: 768px) { .vg-page { padding-top: 1.5rem; padding-bottom: 3rem; } .vg-page .section-head { margin-bottom: 1.25rem; } }
@media (max-width: 480px) { .vg-audio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; } }

/* ---- Educational games (EGF) ---- */
.vg-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2rem 1.5rem; }
.vg-game-card { display: block; color: inherit; text-decoration: none; transition: transform .25s; }
.vg-game-card:hover { transform: translateY(-6px); color: inherit; }
.vg-game-cover { aspect-ratio: 3/4; position: relative; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(160deg, var(--c1, #1f2a2a), var(--c2, #0b0f0f)); display: flex; align-items: flex-end; padding: 1rem; color: #fff; }
.vg-game-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vg-game-cover-title { position: relative; font-family: 'Crimson Pro', Georgia, serif; font-weight: 700; font-size: 1.3rem; line-height: 1.15; max-width: 85%; }
.vg-game-lang { position: absolute; left: .6rem; top: .6rem; background: rgba(0,0,0,.72); color: #fff; font-size: .7rem; font-weight: 600; padding: .2rem .5rem; letter-spacing: .04em; text-transform: uppercase; }
.vg-game-play { position: absolute; right: .7rem; bottom: .7rem; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #000; display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: background .2s, color .2s; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.vg-game-play i { margin-left: 2px; }
.vg-game-card:hover .vg-game-play { background: var(--accent); color: #fff; }
.vg-game-card h3 { font-size: .98rem; margin: .85rem 0 .2rem; letter-spacing: -.01em; font-weight: 600; line-height: 1.3; }
.vg-game-card p { font-size: .8125rem; color: var(--muted); margin: 0 0 .5rem; }
.vg-game-meta { display: flex; gap: .4rem; flex-wrap: wrap; }

.vg-game-detail { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 3rem; align-items: start; }
.vg-game-detail .vg-game-cover { padding: 1.5rem; }
.vg-game-facts { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem; margin: 1.5rem 0; font-size: .9rem; }
.vg-game-facts dt { color: var(--muted); }
.vg-game-facts dd { margin: 0; font-weight: 500; }
.vg-egf-credit { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border: 1px solid var(--line); background: var(--soft); font-size: .85rem; color: var(--muted); margin-top: 2rem; }
.vg-egf-credit img { height: 38px; width: auto; flex-shrink: 0; }
.vg-egf-credit a { color: var(--ink); text-decoration: underline; }

.vg-player { position: relative; background: #0b0f14; border: 1px solid var(--line-strong); }
.vg-player iframe { display: block; width: 100%; height: clamp(560px, calc(100vh - 230px), 940px); border: 0; background: #fff; }
.vg-player-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.vg-upload-drop { border: 2px dashed var(--line-strong); background: var(--soft); padding: 2rem 1.5rem; text-align: center; transition: border-color .2s, background .2s; cursor: pointer; display: block; }
.vg-upload-drop:hover, .vg-upload-drop.is-over { border-color: var(--accent); background: var(--accent-50); }
.vg-upload-drop i { font-size: 2rem; color: var(--accent); margin-bottom: .75rem; display: block; }
.vg-upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 800px) {
    .vg-game-detail { grid-template-columns: 1fr; gap: 1.5rem; }
    .vg-game-detail .vg-game-cover { max-width: 280px; }
    .vg-player iframe { height: calc(100vh - 150px); min-height: 480px; }
}
