/* ==========================================================================
   Theme modelled on the Faculty of Engineering, University of Peradeniya site
   (eng.pdn.ac.lk): Readex Pro, institutional blue/navy, gold accent,
   light-grey canvas, white 10px cards with soft shadows, square header.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
    /* Brand */
    --brand-blue: #005FA3;
    --brand-navy: #003A70;
    --brand-mid: #1C518A;
    --brand-gold: #FFC145;
    --brand-gold-dark: #E0A21F;

    /* Legacy token names (used throughout page markup) */
    --primary-color: var(--brand-blue);
    --primary-glow: rgba(0, 95, 163, 0.12);
    --secondary-color: var(--brand-navy);
    --secondary-glow: rgba(0, 58, 112, 0.12);

    --bg-color: #F4F4F4;
    --bg-color-light: #ffffff;
    --text-main: #1F1F1F;
    --text-muted: #4A4A4A;
    --glass-bg: #ffffff;
    --glass-border: #e5e7eb;
    --glass-hover: #f3f6fa;

    --radius: 10px;
    --radius-btn: 3px;
    --shadow-sm: 2px 4px 20px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 5px 20px 75px 0 rgba(0, 0, 0, 0.15);
    --content-width: 1120px;
    --font: 'Readex Pro', system-ui, sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Inline styles in the pages still name the old fonts — map them over */
[style*="Inter"],
[style*="Outfit"] {
    font-family: var(--font) !important;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font);
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-main);
}

/* Accent text (was a gradient; now the solid institutional blue) */
.text-gradient {
    color: var(--brand-blue);
    background: none;
    -webkit-text-fill-color: currentColor;
}

/* ==========================================================================
   Header: sticky white nav bar
   ========================================================================== */
/* Utility strip above the header */
.topbar {
    background: var(--brand-navy);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
}

.topbar-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0.45rem 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.topbar-links {
    display: inline-flex;
    align-items: center;
    gap: 1.1rem;
}

.topbar svg {
    width: 14px;
    height: 14px;
}

.topbar a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}

.topbar a:hover {
    color: var(--brand-gold);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 3px solid var(--brand-gold);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.navbar {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0.75rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-navy) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: grid;
    place-items: center;
    letter-spacing: 0.5px;
    box-shadow: inset 0 -3px 0 var(--brand-gold);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-text strong {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brand-navy);
}

.logo-text small {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.nav-links {
    display: flex;
    gap: 0.1rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: flex-end;
}

.nav-links li a {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius-btn);
    position: relative;
    transition: var(--transition);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.15rem;
    height: 2px;
    background: var(--brand-gold);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--brand-blue);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    transform: scaleX(1);
}

.nav-actions:empty,
.nav-actions:has(.hamburger) {
    display: none;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    color: var(--brand-navy);
    padding: 0.4rem;
    line-height: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */
main {
    flex: 1;
    padding: 0 20px 5rem;
    margin: 0 auto;
    width: 100%;
    max-width: calc(var(--content-width) + 40px);
}

/* Home hero: full-bleed cover image under a navy wash, like the faculty hero */
.hero-banner {
    min-height: calc(100vh - 105px) !important;
    border-bottom: none !important;
}

.hero-banner>div:first-child {
    background: linear-gradient(100deg, rgba(0, 58, 112, 0.94) 0%, rgba(0, 95, 163, 0.82) 55%, rgba(0, 58, 112, 0.55) 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.hero-banner .hero {
    max-width: var(--content-width) !important;
    padding: 4rem 20px !important;
}

.hero-banner h1,
.hero-banner h2,
.hero-banner p {
    color: #fff !important;
}

.hero-banner .text-gradient {
    color: var(--brand-gold);
}

.hero-banner .greeting-wrapper {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.hero-banner .greeting,
.hero-banner .code-bracket {
    color: rgba(255, 255, 255, 0.85);
    border-right-color: var(--brand-gold);
}

.hero-banner .code-tag {
    color: var(--brand-gold);
}

.hero-banner .btn-primary {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: var(--brand-navy);
}

.hero-banner .btn-primary:hover {
    background: #fff;
    border-color: #fff;
    color: var(--brand-navy);
}

.hero-banner .btn-outline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
}

.hero-banner .btn-outline:hover {
    background: #fff;
    color: var(--brand-navy);
    border-color: #fff;
}

.hero-banner .image-wrapper {
    background: var(--brand-gold);
}

/* Hero */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1.3;
    animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.greeting-wrapper {
    display: inline-flex;
    background: var(--bg-color-light);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    align-items: center;
}

.greeting {
    font-size: 1rem;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--text-main);
    width: 22ch;
    animation: typing 2.5s steps(22, end) forwards, blink 0.75s step-end infinite;
}

.code-bracket {
    color: var(--text-muted);
}

.code-tag {
    color: var(--primary-color);
}

.hero-title {
    font-size: 3.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.1rem;
    font-weight: 300 !important;
    color: var(--text-main);
    margin-bottom: 2.5rem;
    max-width: 640px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    animation: fadeIn 1.2s ease-in forwards;
}

.image-wrapper {
    width: 400px;
    height: 460px;
    border-radius: var(--radius);
    background: var(--brand-blue);
    padding: 6px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

/* offset frame accent */
.image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translate(18px, 18px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    z-index: -1;
}

.image-inner {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color-light);
    border-radius: 6px;
    overflow: hidden;
}

.image-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-wrapper:hover .image-inner img {
    transform: scale(1.04);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-group {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 14px 24px;
    border-radius: var(--radius-btn);
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
}

.btn-primary:hover {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
}

.btn-outline {
    background: transparent;
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.btn-outline:hover {
    background: var(--brand-blue);
    color: #fff;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.glass-card {
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2.25rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.glass-card::before {
    display: none;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

/* ==========================================================================
   Page headers
   ========================================================================== */
.page-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn 0.8s ease-out forwards;
}

.page-title {
    font-size: 2.6rem;
    margin-bottom: 1rem;
}

/* the little underline bar under section titles → gold */
.page-header>div[style*="height: 6px"] {
    background: var(--brand-gold) !important;
    height: 4px !important;
    width: 64px !important;
    border-radius: 2px !important;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Inner-page title banner (full bleed, navy gradient) */
.page-banner {
    margin: 0 calc(50% - 50vw) 4rem !important;
    padding: 4.5rem 20px 4rem;
    background:
        linear-gradient(135deg, rgba(0, 95, 163, 0.96) 0%, rgba(0, 95, 163, 0.92) 55%, rgba(0, 58, 112, 0.97) 100%),
        url('../images/hero-light-bg.jpg') center/cover no-repeat;
    color: #fff;
    position: relative;
}

.page-banner .page-title,
.page-banner .text-gradient {
    color: #fff;
}

.page-banner .page-title {
    font-size: 2.8rem;
}

.page-banner .page-subtitle,
.page-banner p {
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumb {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.9rem;
    letter-spacing: 0.3px;
}

.breadcrumb a {
    color: var(--brand-gold);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Grids & timeline
   ========================================================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: #cfd8e3;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
    animation: slideLeft 0.8s ease-out forwards;
    opacity: 0;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-blue);
    border: 4px solid var(--brand-gold);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--brand-navy);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: rgba(255, 193, 69, 0.25);
    border-radius: var(--radius-btn);
}

/* ==========================================================================
   Skills / tags / badges
   ========================================================================== */
.skill-category {
    margin-bottom: 3rem;
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: #fff;
    border: 1px solid var(--glass-border);
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-btn);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.skill-tag:hover {
    background: var(--glass-hover);
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.tag-primary {
    color: var(--brand-blue) !important;
    border: 1px solid rgba(0, 95, 163, 0.45) !important;
}

.tag-primary:hover {
    background: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: #fff !important;
}

.tag-primary:hover i,
.tag-primary:hover svg {
    color: #fff !important;
}

.tag-secondary {
    color: var(--brand-navy) !important;
    border: 1px solid rgba(0, 58, 112, 0.45) !important;
    background: rgba(255, 193, 69, 0.12) !important;
}

.tag-secondary:hover {
    background: var(--brand-navy) !important;
    border-color: var(--brand-navy) !important;
    color: #fff !important;
}

.tag-secondary:hover i,
.tag-secondary:hover svg {
    color: #fff !important;
}

.status-badge {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-btn);
    white-space: nowrap;
    height: fit-content;
    align-self: flex-start;
    transition: var(--transition);
    cursor: default;
    letter-spacing: 0.3px;
}

.badge-published,
.badge-completed {
    background: var(--brand-navy);
    color: #fff;
    border: 1px solid var(--brand-navy);
}

.badge-published:hover,
.badge-completed:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

.badge-inprogress {
    background: rgba(255, 193, 69, 0.2);
    color: var(--brand-navy);
    border: 1px solid var(--brand-gold);
}

.badge-inprogress:hover {
    background: var(--brand-gold);
}

/* ==========================================================================
   Contact form
   ========================================================================== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-control {
    background: #fff;
    border: 1px solid #d1d5db;
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-btn);
    font-family: var(--font);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 95, 163, 0.18);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    margin-top: auto;
    background: var(--brand-navy);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    border-top: 4px solid var(--brand-gold);
}

.footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 3.5rem 20px 2.5rem;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
    gap: 2.5rem;
}

.site-footer h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    position: relative;
}

.site-footer h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 2px;
    background: var(--brand-gold);
}

.site-footer .logo-text strong {
    color: #fff;
}

.site-footer .logo-text small {
    color: rgba(255, 255, 255, 0.65);
}

.footer-brand p {
    margin: 1rem 0 1.25rem;
    line-height: 1.7;
}

.footer-links li {
    margin-bottom: 0.45rem;
}

.footer-links a,
.footer-contact a {
    transition: color 0.2s;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--brand-gold);
}

.footer-contact li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-bottom: 0.7rem;
    line-height: 1.5;
}

.footer-contact svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--brand-gold);
}

.footer-social {
    display: flex;
    gap: 0.6rem;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-btn);
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    color: #fff;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--brand-gold);
    color: var(--brand-navy);
}

.footer-social svg {
    width: 17px;
    height: 17px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.15);
}

.footer-bottom p {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 1rem 20px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 22ch;
    }
}

@keyframes blink {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: currentColor;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 0.5rem 20px 1rem;
        border-bottom: 3px solid var(--brand-gold);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
        display: none;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li a {
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid var(--glass-border);
        border-radius: 0;
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-links li a::after {
        display: none;
    }

    .nav-links li a.active {
        background: var(--glass-hover);
        box-shadow: inset 3px 0 0 var(--brand-gold);
    }

    .nav-actions:has(.hamburger) {
        display: block;
    }

    .hamburger {
        display: block;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-desc {
        margin: 0 auto 2.5rem;
    }

    .btn-group {
        justify-content: center;
    }

    .hero-content>div:last-child {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.4rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .page-title,
    .page-banner .page-title {
        font-size: 2rem;
    }

    .page-banner {
        padding: 3rem 20px 2.75rem;
    }

    .image-wrapper {
        width: 260px;
        height: 300px;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .logo-text small {
        display: none;
    }
}

/* Disabled (non-clickable) button */
.btn-disabled,
.btn-disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    background: transparent;
    color: var(--text-muted);
    border-color: var(--glass-border);
}

/* ==========================================================================
   Media button + popup viewer
   ========================================================================== */
.btn-media {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: var(--brand-navy);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-media:hover {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #fff;
}

body.mv-open {
    overflow: hidden;
}

.media-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.media-viewer[hidden] {
    display: none;
}

.mv-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 20, 45, 0.85);
    animation: fadeIn 0.2s ease;
}

.mv-panel {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius);
    border-top: 4px solid var(--brand-gold);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

.mv-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.mv-album {
    flex: 1;
    font-weight: 600;
    color: var(--brand-navy);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mv-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.mv-close,
.mv-nav {
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: var(--transition);
}

.mv-close {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-btn);
    background: var(--glass-hover);
    color: var(--brand-navy);
}

.mv-close:hover {
    background: var(--brand-navy);
    color: #fff;
}

.mv-stage {
    position: relative;
    background: #0d1b2a;
    display: grid;
    place-items: center;
    min-height: 200px;
    flex: 1 1 auto;
    overflow: hidden;
}

.mv-img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.mv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-navy);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mv-nav:hover {
    background: var(--brand-gold);
}

.mv-nav[hidden] {
    display: none;
}

.mv-prev {
    left: 12px;
}

.mv-next {
    right: 12px;
}

.mv-caption {
    padding: 1rem 1.25rem 0.75rem;
}

.mv-title {
    font-size: 1.15rem;
    color: var(--brand-navy);
    margin-bottom: 0.3rem;
}

.mv-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.mv-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 1.25rem 1rem;
    overflow-x: auto;
}

.mv-thumbs[hidden] {
    display: none;
}

.mv-thumbs button {
    flex: 0 0 auto;
    width: 72px;
    height: 54px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    background: none;
    transition: var(--transition);
}

.mv-thumbs button.active,
.mv-thumbs button:hover {
    opacity: 1;
    border-color: var(--brand-gold);
}

.mv-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .media-viewer {
        padding: 10px;
    }

    .mv-img {
        max-height: 50vh;
    }

    .mv-nav {
        width: 38px;
        height: 38px;
    }
}

/* Media viewer: PDF support */
.mv-img[hidden],
.mv-pdf[hidden],
.mv-open-file[hidden] {
    display: none;
}

.mv-pdf {
    width: 100%;
    height: 65vh;
    border: 0;
    background: #fff;
}

.mv-is-pdf .mv-stage {
    background: #e5e7eb;
}

/* keep arrows clear of the PDF toolbar/scrollbar */
.mv-is-pdf .mv-nav {
    top: auto;
    bottom: 12px;
    transform: none;
}

.mv-open-file {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brand-blue);
}

.mv-open-file svg {
    width: 16px;
    height: 16px;
}

.mv-open-file:hover {
    text-decoration: underline;
}

.mv-thumb-pdf {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.65rem;
    font-weight: 700;
}

.mv-thumb-pdf svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .mv-pdf {
        height: 55vh;
    }
}
