/* ==========================================================================
   AGAMI REDESIGN: home hero slider, ebook library, ebook single page
   Built on the tokens in assunnah_theme.css (colors and the 8/6/4px radius
   scale). Headings use Anek Bangla; body text keeps Hind Siliguri.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Anek+Bangla:wght@600;700;800&display=swap');

:root {
    --ag-navy: #0f2547;
    --ag-navy-2: #16336a;
    --ag-navy-tile: #13305e;
    --ag-ink: #13284a;
    --ag-orange: var(--as-orange, #f57212);
    --ag-orange-dark: var(--as-orange-dark, #d45b03);
    --ag-orange-soft: #ffae6b;
    --ag-orange-tint: #fdeee2;
    --ag-blue: #1f63e0;
    --ag-blue-dark: #174fb8;
    --ag-green: #1a9a5c;
    --ag-green-tint: #dff3e8;
    --ag-green-ink: #137a47;
    --ag-bg: #f6f8fb;
    --ag-border: #e3e8ef;
    --ag-border-strong: #d3dae5;
    --ag-divider: #eef2f8;
    --ag-muted: #5b6778;
    --ag-body: #45505f;
    --ag-on-navy: #c3d0e6;
    --ag-on-navy-muted: #9fb4d8;
    --ag-error: #c93a2a;
    --ag-font-head: 'Anek Bangla', 'Hind Siliguri', sans-serif;
}

/* Used together with Bootstrap's .container so these sections line up with the header. */
.ag-container {
    position: relative;
    z-index: 2;
}

.ag-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}

/* ---------- Shared navy hero background ---------- */
.ag-navy {
    position: relative;
    overflow: hidden;
    background: var(--ag-navy);
    color: #ffffff;
}

.ag-navy::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1.2px, transparent 1.2px);
    background-size: 22px 22px;
    pointer-events: none;
}

.ag-deco-circle,
.ag-deco-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ag-deco-circle {
    width: 46vw;
    height: 46vw;
    max-width: 720px;
    max-height: 720px;
    background: var(--ag-navy-2);
    top: -18vw;
    right: -12vw;
}

.ag-deco-ring {
    width: 180px;
    height: 180px;
    border: 32px solid var(--ag-orange);
    bottom: -90px;
    left: -60px;
    opacity: 0.9;
}

.ag-deco-ring.is-right {
    left: auto;
    right: 4vw;
    bottom: -110px;
}

/* ---------- Shared type and controls ---------- */
.ag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--as-radius-xs, 4px);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    background: rgba(245, 114, 18, 0.14);
    color: var(--ag-orange-soft);
    border: 1px solid rgba(245, 114, 18, 0.4);
}

.ag-badge.is-solid {
    background: var(--ag-orange);
    border-color: var(--ag-orange);
    color: #ffffff;
}

.ag-badge.is-blue {
    background: rgba(31, 99, 224, 0.2);
    border-color: rgba(31, 99, 224, 0.5);
    color: #b9cdf7;
}

.ag-badge.is-white {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.ag-badge.is-green {
    background: var(--ag-green);
    border-color: var(--ag-green);
    color: #ffffff;
}

.ag-title {
    font-family: var(--ag-font-head);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: #ffffff;
    margin: 20px 0 18px;
}

.ag-title .is-accent {
    color: var(--ag-orange);
}

.ag-lead {
    font-size: clamp(17px, 1.4vw, 19px);
    line-height: 1.7;
    color: var(--ag-on-navy);
    max-width: 560px;
    margin: 0 0 30px;
}

.ag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border-radius: var(--as-radius-sm, 6px);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ag-btn-orange {
    background: var(--ag-orange);
    color: #ffffff !important;
}

.ag-btn-orange:hover {
    background: var(--ag-orange-dark);
}

.ag-btn-blue {
    background: var(--ag-blue);
    color: #ffffff !important;
}

.ag-btn-blue:hover {
    background: var(--ag-blue-dark);
}

.ag-btn-ghost {
    background: transparent;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.5);
}

.ag-btn-ghost:hover {
    background: #ffffff;
    color: var(--ag-ink) !important;
    border-color: #ffffff;
}

.ag-btn-sm {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 14px;
}

.ag-btn-block {
    width: 100%;
}

/* ==========================================================================
   Home hero slider
   ========================================================================== */
.ag-hero {
    --ag-slide-pad-top: clamp(48px, 7vw, 96px);
    --ag-slide-pad-bottom: clamp(96px, 9vw, 120px);
}

.ag-hero-viewport {
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.ag-hero-track {
    display: flex;
    transition: transform 0.7s cubic-bezier(0.7, 0, 0.2, 1);
    will-change: transform;
}

.ag-slide {
    flex: 0 0 100%;
    min-width: 100%;
    padding: var(--ag-slide-pad-top) 0 var(--ag-slide-pad-bottom);
}

.ag-slide .ag-title {
    font-size: clamp(38px, 5vw, 66px);
}

.ag-slide:first-child .ag-title {
    font-size: clamp(40px, 5.4vw, 72px);
}

.ag-slide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ag-visual {
    position: relative;
    min-height: 420px;
}

/* Slide 1: factory frame with point card */
.ag-frame {
    position: absolute;
    top: 0;
    right: 0;
    width: 78%;
    height: 82%;
    border-radius: var(--as-radius, 8px) var(--as-radius, 8px) var(--as-radius, 8px) 96px;
    overflow: hidden;
    background: repeating-linear-gradient(135deg, #1c3d78 0 14px, #18366b 14px 28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ag-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ag-frame-methods {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #ffffff;
    text-align: center;
    padding: 24px;
}

.ag-frame-methods > i {
    font-size: 56px;
    color: var(--ag-orange-soft);
    line-height: 1;
}

.ag-frame-methods ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 320px;
}

.ag-frame-methods li {
    font-size: 14px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--as-radius-xs, 4px);
    background: rgba(15, 37, 71, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.ag-dot-sun {
    position: absolute;
    top: 8%;
    left: 4%;
    width: 30%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--ag-orange);
}

.ag-dot-grid {
    position: absolute;
    top: 2%;
    left: 12%;
    width: 22%;
    aspect-ratio: 1;
    border-radius: 50%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1.6px, transparent 1.6px);
    background-size: 12px 12px;
}

.ag-float-card {
    position: absolute;
    left: 0;
    bottom: 0;
    width: min(300px, 70%);
    background: #ffffff;
    border-radius: var(--as-radius, 8px);
    padding: 18px 20px;
    box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.5);
    color: var(--ag-ink);
}

.ag-float-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ag-float-card li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.ag-float-card li::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transform: translateY(-1px);
    background: var(--ag-dot, var(--ag-blue));
}

/* Slide 2: batch ticket */
.ag-visual-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ag-ticket-ring {
    position: absolute;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.18);
}

.ag-ticket-square {
    position: absolute;
    top: 6%;
    right: 10%;
    width: 64px;
    height: 64px;
    border-radius: var(--as-radius, 8px);
    background: var(--ag-blue);
    transform: rotate(12deg);
}

.ag-ticket-dot {
    position: absolute;
    bottom: 12%;
    left: 12%;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ag-orange);
}

.ag-ticket {
    position: relative;
    width: min(340px, 90%);
    background: #ffffff;
    color: var(--ag-ink);
    border-radius: var(--as-radius, 8px);
    overflow: hidden;
    box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.5);
}

.ag-ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ag-orange);
    color: #ffffff;
    padding: 14px 22px;
    font-weight: 600;
    font-size: 15px;
}

.ag-ticket-body {
    padding: 20px 22px 22px;
}

.ag-ticket-day {
    font-family: var(--ag-font-head);
    font-weight: 800;
    font-size: clamp(96px, 10vw, 132px);
    line-height: 0.9;
    color: var(--ag-ink);
}

.ag-ticket-label {
    font-size: 16px;
    color: var(--ag-muted);
    font-weight: 600;
    margin-top: 6px;
}

.ag-ticket-fee {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 2px dashed var(--ag-border);
    margin-top: 18px;
    padding-top: 16px;
    font-size: 15px;
    color: var(--ag-muted);
}

.ag-ticket-fee strong {
    font-family: var(--ag-font-head);
    font-size: 26px;
    font-weight: 800;
    color: var(--ag-blue);
}

/* Slide 3: stacked course rows */
.ag-course-stack {
    position: relative;
    width: min(440px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ag-course-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border-radius: var(--as-radius, 8px);
    padding: 14px 16px;
    text-decoration: none !important;
    color: var(--ag-ink);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease;
}

.ag-course-row:nth-child(1) { transform: translateX(-24px); }
.ag-course-row:nth-child(3) { transform: translateX(24px); }
.ag-course-row:hover { color: var(--ag-ink); }

.ag-course-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--as-radius-sm, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: var(--ag-font-head);
    font-weight: 800;
    font-size: 15px;
    background: var(--ag-tile, var(--ag-orange));
}

.ag-course-row-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    display: block;
}

.ag-course-row-price {
    font-family: var(--ag-font-head);
    font-weight: 700;
    color: var(--ag-blue);
    font-size: 16px;
}

/* Slider controls */
.ag-hero-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(28px, 3vw, 40px);
    z-index: 3;
}

.ag-hero-controls .ag-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ag-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ag-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.4s ease;
}

.ag-dot.is-active {
    width: 36px;
    background: var(--ag-orange);
}

.ag-arrows {
    display: flex;
    gap: 10px;
}

.ag-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: #ffffff;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ag-arrow:hover {
    border-color: #ffffff;
}

.ag-arrow.is-next {
    background: var(--ag-orange);
    border-color: var(--ag-orange);
}

.ag-arrow.is-next:hover {
    background: var(--ag-orange-dark);
}

.ag-arrow i {
    line-height: 1;
    display: flex;
}

/* ==========================================================================
   Book covers (uploaded image or CSS fallback)
   ========================================================================== */
.ag-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 3px var(--as-radius, 8px) var(--as-radius, 8px) 3px;
    overflow: hidden;
    background: var(--ag-cover-bg, var(--ag-ink));
    color: var(--ag-cover-ink, #ffffff);
    box-shadow: 0 16px 32px -18px rgba(19, 40, 74, 0.6);
}

.ag-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ag-cover-art {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 12% 12% 10% 18%;
}

.ag-cover-art::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 7%;
    min-width: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.ag-cover-art::after {
    content: '';
    position: absolute;
    right: -18%;
    bottom: -14%;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--ag-cover-accent, var(--ag-orange));
}

.ag-cover-cat {
    position: relative;
    z-index: 1;
    font-size: 0.72em;
    font-weight: 600;
    opacity: 0.85;
}

.ag-cover-title {
    position: relative;
    z-index: 1;
    margin: auto 0;
    font-family: var(--ag-font-head);
    font-weight: 800;
    font-size: 1.45em;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.ag-cover-brand {
    position: relative;
    z-index: 1;
    font-size: 0.7em;
    opacity: 0.85;
}

.ag-cover.is-navy { --ag-cover-bg: var(--ag-ink); --ag-cover-accent: var(--ag-blue); }
.ag-cover.is-blue { --ag-cover-bg: var(--ag-blue); --ag-cover-accent: var(--ag-orange); }
.ag-cover.is-orange { --ag-cover-bg: var(--ag-orange); --ag-cover-accent: var(--ag-ink); }
.ag-cover.is-white { --ag-cover-bg: #ffffff; --ag-cover-ink: var(--ag-ink); --ag-cover-accent: var(--ag-orange); }
.ag-cover.is-white .ag-cover-art::before { background: rgba(19, 40, 74, 0.1); }

/* On the navy hero a navy cover would disappear, so it switches to orange there. */
.ag-single-cover-wrap .ag-cover.is-navy { --ag-cover-bg: var(--ag-orange); --ag-cover-accent: var(--ag-ink); }

/* Tiny covers keep the color and shapes only; text at that size is unreadable. */
.ag-mini .ag-cover-art > * { visibility: hidden; }

/* ==========================================================================
   Ebook library (/ebooks)
   ========================================================================== */
.ag-page {
    background: var(--ag-bg);
    padding-bottom: 80px;
}

.ag-lib-hero {
    padding: clamp(48px, 6vw, 80px) 0 clamp(80px, 8vw, 110px);
}

.ag-lib-hero .ag-title {
    font-size: clamp(36px, 4.6vw, 60px);
}

.ag-search {
    display: flex;
    gap: 6px;
    max-width: 600px;
    background: #ffffff;
    border-radius: var(--as-radius, 8px);
    padding: 6px;
}

.ag-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 10px 12px;
    font-size: 16px;
    color: var(--ag-ink);
    background: transparent;
}

.ag-filter-bar {
    position: relative;
    z-index: 3;
    margin-top: -32px;
    background: #ffffff;
    border: 1px solid var(--ag-border);
    border-radius: var(--as-radius, 8px);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 16px 32px -24px rgba(19, 40, 74, 0.4);
}

.ag-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    background: var(--ag-divider);
    border-radius: var(--as-radius, 8px);
    padding: 4px;
    gap: 2px;
}

.ag-segmented a {
    padding: 8px 14px;
    border-radius: var(--as-radius-sm, 6px);
    font-size: 15px;
    font-weight: 600;
    color: var(--ag-muted);
    text-decoration: none;
    white-space: nowrap;
}

.ag-segmented a.is-active {
    background: #ffffff;
    color: var(--ag-ink);
    box-shadow: 0 1px 3px rgba(19, 40, 74, 0.12);
}

.ag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ag-chip {
    padding: 7px 14px;
    border-radius: var(--as-radius-sm, 6px);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--ag-border-strong);
    background: #ffffff;
    color: var(--ag-ink);
    text-decoration: none;
    white-space: nowrap;
}

.ag-chip:hover {
    border-color: var(--ag-ink);
    color: var(--ag-ink);
}

.ag-chip.is-active {
    background: var(--ag-ink);
    border-color: var(--ag-ink);
    color: #ffffff;
}

.ag-results-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 40px 0 24px;
}

.ag-h2 {
    font-family: var(--ag-font-head);
    font-weight: 700;
    font-size: 26px;
    color: var(--ag-ink);
    margin: 0;
}

.ag-muted {
    color: var(--ag-muted);
    font-size: 15px;
}

.ag-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 28px;
}

.ag-book {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--ag-border);
    border-radius: var(--as-radius, 8px);
    overflow: hidden;
    text-decoration: none !important;
    color: var(--ag-ink);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ag-book:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 40px -24px rgba(19, 40, 74, 0.45);
    color: var(--ag-ink);
}

.ag-book-stage {
    position: relative;
    padding: 28px 36px 0;
    background: var(--ag-stage, #eef2f8);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 220px;
}

.ag-book-stage .ag-cover {
    width: 72%;
    font-size: 13px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    aspect-ratio: 3 / 3.4;
}

.ag-book-flag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 3px 9px;
    border-radius: var(--as-radius-xs, 4px);
    font-size: 13px;
    font-weight: 600;
}

.ag-book-flag.is-free {
    background: var(--ag-green-tint);
    color: var(--ag-green-ink);
}

.ag-book-flag.is-paid {
    background: var(--ag-ink);
    color: #ffffff;
}

.ag-book-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ag-book-meta {
    font-size: 13px;
    color: var(--ag-muted);
    margin-bottom: 6px;
}

.ag-book-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 16px;
}

.ag-book-foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--ag-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ag-price {
    font-family: var(--ag-font-head);
    font-weight: 700;
    font-size: 20px;
    color: var(--ag-ink);
}

.ag-price.is-free {
    color: var(--ag-green);
}

.ag-price del {
    font-size: 0.7em;
    color: var(--ag-muted);
    font-weight: 500;
    margin-left: 4px;
}

.ag-pill-cta {
    padding: 6px 12px;
    border-radius: var(--as-radius-sm, 6px);
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: var(--ag-orange);
    white-space: nowrap;
}

.ag-pill-cta.is-free {
    background: var(--ag-blue);
}

.ag-empty {
    border: 2px dashed var(--ag-border-strong);
    border-radius: var(--as-radius, 8px);
    padding: 56px 24px;
    text-align: center;
    background: #ffffff;
}

.ag-empty h3 {
    font-family: var(--ag-font-head);
    font-size: 22px;
    color: var(--ag-ink);
    margin-bottom: 16px;
}

/* ==========================================================================
   Ebook single (/ebook/{slug})
   ========================================================================== */
.ag-single-hero {
    padding: 28px 0 clamp(56px, 7vw, 88px);
}

.ag-crumbs {
    font-size: 14px;
    color: var(--ag-on-navy-muted);
    margin-bottom: clamp(24px, 4vw, 40px);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ag-crumbs a {
    color: var(--ag-on-navy);
    text-decoration: none;
}

.ag-crumbs a:hover {
    color: #ffffff;
}

.ag-single-cover-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.ag-single-cover-wrap .ag-cover {
    width: min(300px, 70vw);
    font-size: 22px;
    transform: rotate(-3deg);
    box-shadow: 24px 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.ag-single-cover-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(420px, 90%);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.18);
}

.ag-single-cover-wrap .ag-ticket-square {
    top: 4%;
    right: 12%;
    width: 52px;
    height: 52px;
}

.ag-single-cover-wrap .ag-ticket-dot {
    bottom: 14%;
    left: 10%;
}

.ag-single-hero .ag-title {
    font-size: clamp(34px, 4.4vw, 56px);
    margin-top: 16px;
}

.ag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ag-meta-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    border-radius: var(--as-radius, 8px);
    overflow: hidden;
    margin-bottom: 28px;
}

.ag-meta-tiles > div {
    background: var(--ag-navy-tile);
    padding: 14px 16px;
}

.ag-meta-tiles span {
    display: block;
    font-size: 13px;
    color: var(--ag-on-navy-muted);
    margin-bottom: 4px;
}

.ag-meta-tiles strong {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.ag-buy-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.ag-big-price {
    font-family: var(--ag-font-head);
    font-weight: 800;
    font-size: clamp(34px, 3.4vw, 40px);
    color: var(--ag-orange);
    line-height: 1;
}

.ag-big-price.is-free {
    color: #7ee0ad;
}

.ag-big-price del {
    font-size: 0.5em;
    color: var(--ag-on-navy-muted);
    font-weight: 600;
    margin-left: 8px;
}

.ag-single-body {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    padding-top: 48px;
}

.ag-single-main {
    flex: 2 1 560px;
    min-width: 0;
}

.ag-single-side {
    flex: 1 1 320px;
    min-width: 0;
    position: sticky;
    top: 90px;
}

.ag-card {
    background: #ffffff;
    border: 1px solid var(--ag-border);
    border-radius: var(--as-radius, 8px);
    padding: clamp(24px, 3vw, 36px);
}

.ag-card .ag-h2 {
    margin-bottom: 16px;
}

.ag-prose {
    font-size: 17px;
    line-height: 1.75;
    color: var(--ag-body);
}

.ag-prose p {
    margin-bottom: 14px;
}

.ag-prose ul,
.ag-prose ol {
    padding-left: 20px;
}

.ag-toc-label {
    font-weight: 700;
    color: var(--ag-ink);
    margin: 6px 0 8px;
}

.ag-toc {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--ag-divider);
}

.ag-toc li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ag-divider);
    font-size: 17px;
    color: var(--ag-ink);
}

.ag-toc-num {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--as-radius-sm, 6px);
    background: var(--ag-orange-tint);
    color: var(--ag-orange-dark);
    font-family: var(--ag-font-head);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ag-related-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 40px 0 18px;
}

.ag-related-head a {
    color: var(--ag-orange-dark);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}

.ag-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 16px;
}

.ag-mini {
    display: flex;
    gap: 14px;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--ag-border);
    border-radius: var(--as-radius, 8px);
    padding: 12px;
    text-decoration: none !important;
    color: var(--ag-ink);
    transition: border-color 0.2s ease;
}

.ag-mini:hover {
    border-color: var(--ag-border-strong);
    color: var(--ag-ink);
}

.ag-mini .ag-cover {
    width: 60px;
    flex-shrink: 0;
    font-size: 6px;
    box-shadow: none;
}

.ag-mini-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 4px;
}

.ag-mini .ag-price {
    font-size: 17px;
}

.ag-buy-card {
    background: #ffffff;
    border: 1px solid var(--ag-border);
    border-radius: var(--as-radius, 8px);
    overflow: hidden;
    box-shadow: 0 24px 48px -32px rgba(19, 40, 74, 0.5);
    scroll-margin-top: 100px;
}

.ag-buy-head {
    background: var(--ag-navy);
    color: var(--ag-on-navy);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ag-buy-head .ag-big-price {
    font-size: 34px;
}

.ag-buy-features {
    list-style: none;
    padding: 18px 24px;
    margin: 0;
    border-bottom: 1px solid var(--ag-divider);
}

.ag-buy-features li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 5px 0;
    font-size: 15px;
    color: var(--ag-body);
}

.ag-buy-features li::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ag-blue);
    flex-shrink: 0;
    transform: translateY(-2px);
}

.ag-buy-form {
    padding: 20px 24px 24px;
}

.ag-field {
    margin-bottom: 14px;
}

.ag-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ag-ink);
    margin-bottom: 6px;
}

.ag-field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--ag-border-strong);
    border-radius: var(--as-radius-sm, 6px);
    padding: 10px 14px;
    font-size: 16px;
    color: var(--ag-ink);
    background: #ffffff;
}

.ag-field input:focus {
    outline: 0;
    border-color: var(--ag-blue);
    box-shadow: 0 0 0 3px rgba(31, 99, 224, 0.12);
}

.ag-field input.is-invalid {
    border-color: var(--ag-error);
}

.ag-field-error {
    display: none;
    color: var(--ag-error);
    font-size: 13px;
    margin-top: 5px;
}

.ag-field input.is-invalid + .ag-field-error {
    display: block;
}

.ag-buy-note {
    text-align: center;
    font-size: 13px;
    color: var(--ag-muted);
    margin-top: 12px;
}

.ag-alert {
    border-radius: var(--as-radius, 8px);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 15px;
}

.ag-alert.is-error {
    background: #fdecea;
    color: #8f2418;
    border: 1px solid #f5c2bb;
}

.ag-alert.is-success {
    background: var(--ag-green-tint);
    color: var(--ag-green-ink);
    border: 1px solid #b7e3cb;
}

.ag-page .pagination {
    margin-top: 40px;
    justify-content: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
    .ag-visual {
        min-height: 360px;
    }

    .ag-course-row:nth-child(1),
    .ag-course-row:nth-child(3) {
        transform: none;
    }

    .ag-single-side {
        position: static;
    }

    .ag-deco-circle {
        width: 80vw;
        height: 80vw;
        top: -30vw;
        right: -30vw;
    }
}

@media (max-width: 575px) {
    .ag-visual {
        min-height: 320px;
    }

    .ag-slide-actions .ag-btn {
        flex: 1 1 auto;
    }

    /* Keep the printing-method labels clear of the point card that overlaps the frame. */
    .ag-frame-methods {
        justify-content: flex-start;
        padding-top: 28px;
        gap: 12px;
    }

    .ag-frame-methods > i {
        font-size: 40px;
    }

    .ag-filter-bar {
        padding: 12px;
    }

    .ag-deco-ring {
        width: 120px;
        height: 120px;
        border-width: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ag-hero-track,
    .ag-book,
    .ag-dot {
        transition: none;
    }
}
