:root {
    --primary: #11224E;
    --accent: #BF092F;
    --bg: #eee;
    --footer-bg: #d2f1ff;
    --text: #121D3F;
    --text-light: #555;
    --white: #fff;
    --shadow: 0 4px 20px rgba(0,0,0,.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    text-decoration: none;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ========== NAVBAR ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--white);
    border-bottom: 2px solid var(--primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.navbar-logo {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    min-width: 260px;
    min-height: 48px;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.05;
}

.navbar-logo img { display: block; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.navbar-logo b { color: var(--accent); }
.navbar-logo-placeholder { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; }
.navbar-logo span { color: var(--accent); }
.navbar-logo > span { color: var(--primary); }

.navbar-nav a {
    color: var(--primary);
    display: inline-block;
    font-size: 1rem;
    margin: 0 0.8rem;
    font-weight: 500;
    transition: color .3s;
}

.navbar-nav a:hover { color: var(--accent); }

.navbar-nav a::after {
    content: '';
    display: block;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--accent);
    transform: scaleX(0);
    transition: transform .2s linear;
}

.navbar-nav a:hover::after { transform: scaleX(0.7); }

.navbar-extra a {
    color: var(--primary);
    margin: 0 0.4rem;
    font-size: 1.2rem;
}

.navbar-extra a:hover { color: var(--accent); }

#hamburger-menu { display: none; cursor: pointer; }

/* ========== HERO ========== */
.hero {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    background: url('../img/header-3-bg.jpg') no-repeat center/cover;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(17, 34, 78, .45);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg) 5%, transparent 45%);
}

.hero .content {
    padding: 1.4rem 7%;
    max-width: 60rem;
    z-index: 2;
    position: relative;
}

.hero .content h1 {
    font-size: 4rem;
    color: var(--white);
    text-shadow: 2px 2px 8px rgba(0,0,0,.4);
    line-height: 1.1;
}

.hero .content h1 span { color: var(--accent); }

.hero .content p {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    color: rgba(255,255,255,.9);
    line-height: 1.4;
    text-shadow: 1px 1px 4px rgba(0,0,0,.3);
}

.hero .content .cta {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: 500;
    margin-top: 1rem;
    transition: all .3s ease;
}

.hero .content .cta:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,.3);
}

/* ========== ABOUT SECTION ========== */
.about-section {
    background: var(--bg);
    padding: 5rem 8%;
    position: relative;
    overflow: hidden;
}

.about-section::before,
.about-section::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    animation: float 6s infinite ease-in-out alternate;
}

.about-section::before {
    width: 200px; height: 200px;
    top: -50px; left: -80px;
    background: rgba(191,9,47,.12);
}

.about-section::after {
    width: 300px; height: 300px;
    bottom: -80px; right: -100px;
    background: rgba(17,34,78,.12);
}

.about-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.about-text {
    flex: 1 1 45%;
    animation: fadeInLeft 1s ease forwards;
    opacity: 0;
}

.about-text h2 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
}

.about-text h2::after {
    content: "";
    display: block;
    width: 80px; height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 8px;
}

.about-text p {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1rem;
}

.about-image {
    flex: 1 1 45%;
    text-align: center;
    animation: fadeInRight 1s ease forwards;
    opacity: 0;
}

.about-image img {
    width: 100%;
    max-width: 420px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    transition: transform .4s ease;
}

.about-image img:hover { transform: scale(1.03); }

/* ========== NEWS SECTION ========== */
.news-section {
    padding: 5rem 7%;
    background: var(--bg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.section-heading {
    font-size: 2.4rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.section-heading::after {
    content: "";
    display: block;
    width: 80px; height: 4px;
    background: var(--accent);
    margin: 0.5rem auto;
    border-radius: 2px;
}

.news-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    background: rgba(255,255,255,.9);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .3s ease, box-shadow .3s ease;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(17,34,78,.2);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
    text-align: left;
}

.news-content h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.6rem;
}

.news-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.news-content .news-date {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border-radius: 999px;
    background: rgba(191,9,47,.09);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 700;
    transition: color .3s, background .3s, transform .3s;
}

.read-more::after { content: '\f061'; font-family: 'Font Awesome 6 Free'; font-weight: 900; transition: transform .3s; }
.read-more:hover { color: var(--white); background: var(--accent); transform: translateY(-2px); }
.read-more:hover::after { transform: translateX(3px); }

/* ========== CONTACT SECTION ========== */
.contact-section {
    padding: 4rem 5%;
    background: var(--bg);
}

.contact-section > h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.contact-section > h2 span { color: var(--accent); }

.contact-section > p {
    text-align: center;
    font-size: 1rem;
    max-width: 30rem;
    margin: 0 auto 2rem;
    color: var(--text-light);
}

.contact-section .container {
    background: var(--white);
    margin: auto;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    max-width: 900px;
}

.contact-form {
    flex: 1 1 400px;
}

.contact-form h2 {
    text-align: center;
    margin-bottom: 1.2rem;
    color: #333;
    font-weight: 600;
    font-size: 1.4rem;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    pointer-events: none;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px 15px 10px 38px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
}

.contact-form textarea { resize: none; }

.contact-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    background: var(--primary);
    color: var(--white);
    padding: 10px;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    transition: background .3s;
}

.contact-form button:hover { background: var(--accent); }

.map-container {
    flex: 1 1 400px;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 350px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#status { text-align: center; margin-top: 8px; font-weight: 600; font-size: .9rem; }
.success { color: green; }
.error { color: red; }

/* ========== FOOTER ========== */
footer {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 2rem 5% 3rem;
    margin-top: 2rem;
}

footer .socials { padding: 0.8rem 0; }

footer .socials a {
    color: rgba(255,255,255,.8);
    margin: 0 0.8rem;
    font-size: 1.3rem;
    transition: color .3s;
}

footer .socials a:hover { color: var(--accent); }

footer .credit {
    font-size: 0.9rem;
    color: rgba(255,255,255,.6);
    margin-top: 0.5rem;
}

footer .credit a {
    color: var(--accent);
    font-weight: 600;
}

footer .credit a.creator-link { color: #a78bfa; font-weight: 700; }
footer .credit a.creator-link:hover { color: #f0abfc; }

/* ========== VISION MISSION ========== */
.vision-mission-section {
    padding: 5rem 5%;
    background: linear-gradient(135deg, #f5f7fa, #dbe5ff);
    text-align: center;
    overflow: hidden;
}

.icon-circle {
    width: 60px; height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
    transition: transform .3s;
}

.icon-circle:hover { transform: scale(1.1); }

.vision, .missions {
    background: var(--white);
    border-radius: 15px;
    padding: 2.5rem 2rem;
    margin: 1.5rem auto;
    max-width: 700px;
    box-shadow: var(--shadow);
    transition: transform .3s, box-shadow .3s;
}

.vision:hover, .missions:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
}

.vision h3, .missions h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.vision p {
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
}

.missions ul {
    list-style: none;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.missions ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.5;
}

.missions ul li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ========== PROFILE CARDS ========== */
.profile-section-title {
    text-align: center;
    font-size: 2.2rem;
    margin: 5rem 0 2rem;
    color: var(--primary);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto 3rem;
    padding: 0 5%;
}

.profile-card {
    background: #fbfbfa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(17,34,78,.06);
    text-align: center;
    transition: transform .3s, box-shadow .3s;
    display: flex;
    flex-direction: column;
}

.profile-card:hover {
    transform: translateY(-3px);
    border-color: #cfd5df;
    box-shadow: 0 8px 22px rgba(17,34,78,.1);
}

.profile-card-header {
    background: #f1f2f0;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 1rem 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-card-photo {
    width: 112px;
    height: 112px;
    border-radius: 4px;
    border: 1px solid #d7dbe2;
    object-fit: cover;
    background: var(--white);
    box-shadow: 0 2px 6px rgba(17,34,78,.1);
    display: block;
}

.profile-card-body {
    padding: 1.2rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-card-body h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 4px;
    font-weight: 600;
}

.profile-card-body .role {
    font-size: 0.8rem;
    color: #687386;
    margin-bottom: 4px;
    font-weight: 400;
}

.profile-card-body .uni {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 14px;
}

.profile-card-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.profile-card .profile-card-body .profile-card-socials a.email-link,
.profile-card .profile-card-body .profile-card-socials a.insta-link {
    width: 34px;
    height: 34px;
    min-width: 34px;
    max-width: 34px;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 34px;
    color: #687386;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    text-decoration: none;
    overflow: hidden;
    border: 1px solid #d7dbe2;
    background: transparent;
    transition: transform .2s, color .2s, border-color .2s, background .2s;
}

.profile-card-socials a:hover { transform: translateY(-2px); color: var(--primary); border-color: #aeb7c5; background: #f1f2f0; }
.profile-card-socials a i { display: inline-block; line-height: 1; }

/* ========== ORG CHART ========== */
.organization {
    padding: 6rem 5%;
    background: #f6f7f5;
    text-align: center;
    overflow: hidden;
}

.org-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.25rem;
    max-width: 1180px;
    margin: 0 auto;
}

.org-level {
    position: relative;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    width: 100%;
    padding-top: 1.85rem;
}

.org-level:not(:first-child)::after {
    content: '';
    position: absolute;
    top: -1.65rem;
    left: 50%;
    width: 1px;
    height: 1.65rem;
    background: #cbd2dc;
}

.org-card {
    position: relative;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(17,34,78,.06);
    padding: 1.35rem 1.15rem 1.15rem;
    width: min(220px, 100%);
    transition: transform .25s, box-shadow .25s, border-color .25s;
    overflow: hidden;
    animation: fadeUp .8s ease forwards;
    opacity: 0;
}

.org-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 34px; height: 3px;
    left: 1.15rem;
    background: var(--accent);
}

.org-card:hover {
    transform: translateY(-4px);
    border-color: #bfc8d4;
    box-shadow: 0 9px 22px rgba(17,34,78,.1);
}

.org-card h3 { color: var(--primary); font-size: .95rem; line-height: 1.35; margin-bottom: 6px; }
.org-card p { color: #6a7484; font-size: 0.8rem; margin-bottom: 12px; }

.toggle-members {
    background: transparent;
    color: var(--primary);
    border: 1px solid #d5dae2;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    transition: background .3s;
}

.toggle-members:hover { background: #f1f2f0; border-color: #aeb7c5; }
.toggle-members:focus-visible, .contact-form button:focus-visible, .btn:focus-visible, .nav-icon-btn:focus-visible, .read-more:focus-visible { outline: 3px solid rgba(191,9,47,.35); outline-offset: 3px; }

.members-list {
    list-style: none;
    padding: 8px 0 0;
    display: none;
}

.members-list.active { display: block; }

.members-list li {
    font-size: 0.8rem;
    color: #333;
    background: #f4f5f4;
    border: 1px solid #e5e7eb;
    margin: 3px 0;
    padding: 4px;
    border-radius: 4px;
}

.org-card:nth-child(1) { animation-delay: .1s; }
.org-card:nth-child(2) { animation-delay: .2s; }
.org-card:nth-child(3) { animation-delay: .3s; }
.org-card:nth-child(4) { animation-delay: .4s; }
.org-card:nth-child(5) { animation-delay: .5s; }

/* ========== ACADEMIC / EMBED ========== */
.academic-section {
    padding: 6rem 7% 3rem;
}

.academic-section h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.academic-section iframe {
    width: 100%;
    height: 600px;
    border: 1px solid #ccc;
    border-radius: var(--radius);
}

/* ========== E-MAGOS SECTION ========== */
.emagos-section {
    padding: 5rem 4% 6rem;
    background: #f7f8fc;
}

.emagos-grid {
    display: grid;
    grid-template-columns: minmax(0, 1280px);
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.emagos-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #e7e9f0;
    transition: transform .3s, box-shadow .3s;
}

.emagos-card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(17,34,78,.14); }

.emagos-card-heading { display:flex; align-items:center; justify-content:space-between; padding:1.2rem 1.25rem .9rem; }
.emagos-kicker { display:block; color:var(--accent); font-size:.68rem; font-weight:600; letter-spacing:1.2px; text-transform:uppercase; }

.emagos-card h3 {
    margin-top: .25rem;
    color: var(--primary);
    font-size: 1.1rem;
}

.emagos-card-heading > i { color:var(--accent); font-size:1.3rem; }
.emagos-cover { width:100%; min-height:270px; border:0; background:linear-gradient(145deg,#11224e,#bf092f); color:#fff; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.45rem; font:inherit; transition:filter .2s; }
.emagos-cover:hover { filter:brightness(1.08); }
.emagos-cover-icon { width:70px; height:70px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.45); border-radius:50%; font-size:1.7rem; margin-bottom:.5rem; }
.emagos-cover small { color:rgba(255,255,255,.7); font-size:.78rem; }
.emagos-card-footer { display:flex; justify-content:space-between; gap:1rem; padding:.85rem 1.2rem; color:#747b8e; font-size:.78rem; }
.emagos-card-footer a { color:var(--accent); font-weight:600; }
.emagos-reader { padding:0 1.5rem 1.2rem; background:#f4f6fb; }
.emagos-reader-page { display:flex; align-items:stretch; justify-content:center; gap:2px; min-height:360px; padding:14px; background:#fff; box-shadow:0 5px 18px rgba(17,34,78,.12); }
.emagos-reader-page canvas { display:block; width:50%; max-width:50%; height:auto; object-fit:contain; }
.emagos-reader-page.cover-view canvas:first-child,
.flipbook-page.cover-view canvas:first-child { width:100%; max-width:100%; }

.emagos-card .coming-soon {
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
}

.emagos-card iframe {
    width: 100%;
    height: min(78vh, 820px);
    min-height: 620px;
    border: none;
    display: block;
    background: #505050;
}

.flipbook-modal { position:fixed; inset:0; z-index:10000; display:none; place-items:center; padding:1rem; background:rgba(8,15,36,.82); backdrop-filter:blur(5px); }
.flipbook-modal.open { display:grid; }
.flipbook-shell { position:relative; width:min(940px,100%); max-height:calc(100vh - 2rem); padding:1.3rem; border-radius:16px; background:#eef1f8; box-shadow:0 24px 70px rgba(0,0,0,.35); }
.flipbook-close { position:absolute; right:1rem; top:1rem; z-index:2; width:36px; height:36px; border-radius:50%; background:#fff; color:var(--primary); cursor:pointer; }
.flipbook-top { display:flex; justify-content:space-between; padding:0 .5rem 1rem; color:var(--primary); font-weight:600; }
.flipbook-top span:last-child { color:#747b8e; font-size:.8rem; font-weight:400; }
.flipbook-stage { display:flex; align-items:center; justify-content:center; gap:.7rem; min-height:400px; }
.flipbook-page { display:flex; align-items:stretch; justify-content:center; gap:2px; width:min(900px,calc(100% - 80px)); min-height:460px; padding:14px; background:#fff; box-shadow:0 10px 30px rgba(17,34,78,.18); transform-origin:left center; }
.flipbook-page .page { display:flex; align-items:center; justify-content:center; overflow:hidden; background:#fff; }
.flipbook-page .page canvas { display:block; width:100%; height:100%; object-fit:contain; }
.flipbook-page .stf__parent { margin:auto; }
.flipbook-page.turning { animation:pageTurn .35s ease; }
.flipbook-page canvas { display:block; width:50%; max-width:50%; height:auto; object-fit:contain; }
.flipbook-arrow,.flipbook-controls button,.flipbook-controls a { border:0; border-radius:8px; background:#fff; color:var(--primary); padding:.65rem .8rem; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.08); }
.flipbook-arrow:disabled { opacity:.35; cursor:not-allowed; }
.flipbook-controls { display:flex; justify-content:center; gap:.6rem; padding-top:1rem; }
.flipbook-controls a { text-decoration:none; font-size:.82rem; }
@keyframes pageTurn { from { transform:perspective(1000px) rotateY(-7deg); opacity:.65; } to { transform:perspective(1000px) rotateY(0); opacity:1; } }

/* E-Magos navigation and book-turn feedback */
.emagos-reader-controls button {
    min-width: 108px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: .72rem;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(17,34,78,.2);
    transition: background .2s, transform .2s;
}
.emagos-reader-controls button:hover:not(:disabled) { background: var(--accent); transform: translateY(-2px); }
.flipbook-arrow { display: inline-flex; align-items: center; gap: .45rem; font: inherit; font-size: .76rem; font-weight: 600; white-space: nowrap; transition: background .2s, color .2s, transform .2s; }
.flipbook-arrow:hover:not(:disabled), .flipbook-controls button:hover, .flipbook-controls a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.emagos-reader-page, .flipbook-page { transform-style: preserve-3d; perspective: 1200px; }
.emagos-reader-page.flipping, .flipbook-page.flipping { animation-duration: .72s; animation-timing-function: ease-in-out; animation-fill-mode: both; }
.flip-forward { animation-name: bookFlipForward; }
.flip-back { animation-name: bookFlipBack; }
@keyframes bookFlipForward { 0% { transform: perspective(1200px) rotateY(0); opacity: 1; } 45% { transform: perspective(1200px) rotateY(-16deg); opacity: .6; } 100% { transform: perspective(1200px) rotateY(0); opacity: 1; } }
@keyframes bookFlipBack { 0% { transform: perspective(1200px) rotateY(0); opacity: 1; } 45% { transform: perspective(1200px) rotateY(16deg); opacity: .6; } 100% { transform: perspective(1200px) rotateY(0); opacity: 1; } }

/* ========== NEWS DETAIL ========== */
.news-detail-section {
    padding: 6rem 7% 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.news-detail-section .news-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.news-detail-section .news-meta i { margin-right: 4px; }

.news-detail-section h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.news-detail-section .featured-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.news-detail-section .news-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.news-detail-section .news-body blockquote {
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f9f9f9;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-light);
}

.news-detail-section .news-body p { margin-bottom: 1rem; }

.news-detail-section .share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.news-detail-section .share-buttons a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity .3s;
}

.news-detail-section .share-buttons a:hover { opacity: .85; }
.share-fb { background: #1877F2; }
.share-tw { background: #1DA1F2; }
.share-wa { background: #25D366; }
.share-li { background: #0A66C2; }

/* Related news sidebar */
.news-layout {
    display: flex;
    gap: 2rem;
    padding: 6rem 5% 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.news-main { flex: 2; }
.news-sidebar { flex: 1; min-width: 280px; }

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    position: sticky;
    top: 5rem;
}

.sidebar-card h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.sidebar-item {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    transition: transform .2s;
}

.sidebar-item:hover { transform: translateX(4px); }

.sidebar-item img {
    width: 70px; height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-item-text h4 {
    font-size: 0.85rem;
    color: var(--primary);
    line-height: 1.3;
}

.sidebar-item-text span {
    font-size: 0.75rem;
    color: #999;
}

.sidebar-item-text a {
    color: inherit;
    transition: color .2s;
}

.sidebar-item-text a:hover { color: var(--accent); }

/* ========== REVEAL ANIMATION ========== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all .7s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ========== ANIMATIONS ========== */
@keyframes float {
    from { transform: translateY(0); }
    to { transform: translateY(20px); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== ADMIN STYLES ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 0;
}

/* ---- Sidebar ---- */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary) 0%, #0e1c43 100%);
    color: var(--white);
    padding: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform .3s ease;
}

.admin-sidebar h2 {
    padding: 1.6rem 1.5rem 1.4rem;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    letter-spacing: .5px;
    margin: 0;
    flex-shrink: 0;
}

.admin-sidebar h2 span { color: var(--accent); }

.admin-sidebar nav {
    padding: 0.8rem 0;
    flex: 1;
}

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,.65);
    padding: 0.75rem 1.5rem;
    font-size: 0.92rem;
    transition: all .2s;
    border-left: 3px solid transparent;
    gap: 10px;
}

.admin-sidebar nav a:hover {
    background: rgba(255,255,255,.08);
    color: var(--white);
    border-left-color: rgba(255,255,255,.3);
}

.admin-sidebar nav a.active {
    background: rgba(255,255,255,.12);
    color: var(--white);
    border-left-color: var(--accent);
    font-weight: 500;
}

.admin-sidebar nav a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.admin-sidebar nav hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,.1);
    margin: 0.8rem 1.2rem;
}

/* ---- Mobile sidebar toggle ---- */
.admin-sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    align-items: center;
    justify-content: center;
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}

/* ---- Main content ---- */
.admin-content {
    margin-left: 260px;
    padding: 2rem 2.5rem;
    flex: 1;
    background: #f0f2f5;
    min-height: 100vh;
    transition: margin-left .3s ease;
}

.admin-content h1 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #e0e0e0;
}

/* ---- Cards ---- */
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e8e8e8;
}

.admin-card h2 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 600;
}

/* ---- Stat cards ---- */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 1.5rem 1.2rem;
    text-align: center;
    border: 1px solid #e8e8e8;
    border-left: 4px solid var(--primary);
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.stat-card:nth-child(2) { border-left-color: var(--accent); }
.stat-card:nth-child(3) { border-left-color: #28a745; }
.stat-card:nth-child(4) { border-left-color: #ffc107; }

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.stat-card:nth-child(2) .stat-number { color: var(--accent); }

.stat-card .stat-label {
    color: var(--text-light);
    font-size: 0.88rem;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ---- Admin table ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.admin-table thead { position: sticky; top: 0; }

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.9rem;
    vertical-align: middle;
}

.admin-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.admin-table th:first-child { border-radius: 8px 0 0 0; }
.admin-table th:last-child { border-radius: 0 8px 0 0; }

.admin-table td { border-bottom: 1px solid #f0f0f0; }

.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:nth-child(even) { background: #fafbfc; }
.admin-table tbody tr:hover { background: #eef3ff; }

.admin-table img {
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.admin-table td:last-child {
    white-space: nowrap;
}

.admin-table td:last-child .btn { margin-right: 4px; }

/* ---- Admin form ---- */
.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--primary);
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 1.1rem;
    background: #fafbfc;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17,34,78,.1);
    background: var(--white);
    outline: none;
}

.admin-form input[type="file"] {
    padding: 8px 10px;
    background: var(--white);
    cursor: pointer;
}

.admin-form textarea {
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
}

.admin-form .form-help {
    margin: -.7rem 0 1.1rem;
    color: #8a93a5;
    font-size: .78rem;
}

.admin-form .form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-form .form-row > div { flex: 1; min-width: 180px; }

.admin-form .form-actions {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    border: none;
    line-height: 1.4;
}

.btn i { font-size: 0.85rem; }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(17,34,78,.2);
}
.btn-primary:hover {
    background: #0e1c43;
    box-shadow: 0 4px 12px rgba(17,34,78,.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: var(--white);
    box-shadow: 0 2px 6px rgba(220,53,69,.2);
}
.btn-danger:hover {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220,53,69,.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: var(--white);
}
.btn-secondary:hover { background: #5a6268; }

.btn-danger, .btn-secondary { box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.btn:active, .nav-icon-btn:active, .read-more:active { transform: translateY(0) scale(.97); }

.btn-sm {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Consistent icon navigation controls */
.nav-icon-btn {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(17,34,78,.2);
    transition: background .25s, transform .25s, box-shadow .25s;
}
.nav-icon-btn:hover { background: var(--accent); color: var(--white); transform: translateY(-2px); box-shadow: 0 7px 16px rgba(191,9,47,.25); }

.emagos-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem auto 0;
    color: var(--text-light);
    font-size: .85rem;
    font-weight: 600;
}

/* ---- Login page ---- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #1a3a7a 50%, #0e1c43 100%);
    padding: 1rem;
}

.login-box {
    background: var(--white);
    padding: 2.8rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 420px;
    animation: fadeUp .5s ease;
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.3rem;
    font-size: 2rem;
}

.login-box h1 span { color: var(--accent); }

.login-box p.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.8rem;
    font-size: 0.9rem;
}

.login-box .error-msg {
    background: #fff0f0;
    color: #c00;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #fdd;
}

.login-box .success-msg {
    background: #f0fff0;
    color: #060;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #dfd;
}

/* ---- Alert ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ---- Scrollbar admin sidebar ---- */
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

/* ---- Table responsive wrapper ---- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1366px) {
    html { font-size: 93.75%; }
}

@media (max-width: 1024px) {
    .news-container { grid-template-columns: repeat(2, 1fr); }
    .news-layout { flex-direction: column; }
    .news-sidebar { min-width: auto; }
    .sidebar-card { position: static; }
}

@media (max-width: 768px) {
    html { font-size: 87.5%; }

    #hamburger-menu { display: inline-block; }

    .navbar-nav {
        position: absolute;
        top: 100%;
        right: -100%;
        background: var(--white);
        width: 260px;
        height: 100vh;
        transition: right .3s;
        box-shadow: -5px 0 15px rgba(0,0,0,.1);
        padding-top: 1rem;
    }

    .navbar-nav.active { right: 0; }

    .navbar-nav a {
        display: block;
        margin: 0;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-logo { min-width: 0; min-height: 40px; gap: .45rem; font-size: .95rem; max-width: 235px; }
    .navbar-logo img { width: 34px; height: 34px; }
    .navbar-logo-placeholder { font-size: 1.65rem; }

    .about-container { flex-direction: column; text-align: center; }
    .about-text, .about-image { flex: 1 1 100%; }

    .contact-section .container { flex-direction: column; }

    .hero .content h1 { font-size: 2.5rem; }

    /* Admin responsive: off-canvas sidebar */
    .admin-sidebar-toggle { display: flex; }
    .admin-sidebar {
        transform: translateX(-100%);
        width: 270px;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-sidebar-overlay.open { display: block; }
    .admin-content {
        width: 100%;
        margin-left: 0;
        padding: 1.25rem;
        padding-top: 4.4rem;
    }
    .admin-content h1 { font-size: 1.45rem; margin-bottom: 1rem; }
    .admin-card { padding: 1rem; margin-bottom: 1rem; }
    .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
    .stat-card { padding: 1rem .7rem; }
    .stat-card .stat-number { font-size: 2rem; }
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .admin-form .form-row { display: block; }
    .admin-form .form-row > div { min-width: 0; }
    .admin-form .form-actions { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .news-container { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .news-card img { height: 120px; }
    .news-content { padding: 0.6rem; text-align: center; }
    .news-content p { display: none; }
    .news-content h3 { font-size: 0.9rem; }
    .emagos-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .emagos-section { padding: 3rem 0 4rem; }
    .emagos-grid { gap: 1.25rem; margin-top: 1.25rem; }
    .emagos-card { border-radius: 0; border-left: 0; border-right: 0; }
    .emagos-card-heading { padding: 1rem 1rem .8rem; }
    .emagos-card iframe {
        height: 72vh;
        min-height: 520px;
    }
    .flipbook-shell { padding: .8rem; }
    .flipbook-stage { gap: .25rem; }
    .flipbook-page { width: calc(100% - 46px); min-height: 300px; }
    .flipbook-arrow { padding: .55rem; }
    .flipbook-top { padding-right: 2.5rem; }
    .emagos-reader, .emagos-card-footer, .emagos-card-heading { padding-left: 1rem; padding-right: 1rem; }
    .emagos-pagination { gap: .6rem; font-size: .75rem; }
    .emagos-reader-page { min-height: 250px; padding: 8px; }
    .flipbook-page { min-height: 300px; padding: 8px; }
    .emagos-reader-controls { gap: .45rem; }
    .emagos-reader-controls button { min-width: 90px; font-size: .68rem; }
}

@media (max-width: 450px) {
    html { font-size: 81.25%; }
    .hero .content h1 { font-size: 2rem; }

    /* Admin mobile */
    .admin-content {
        padding: 4rem .8rem 1rem;
    }
    .admin-stats { grid-template-columns: 1fr; }
    .admin-card { padding: .8rem; border-radius: 10px; }
    .admin-table { font-size: 0.78rem; }
    .admin-table th, .admin-table td { padding: 8px 10px; }
    .admin-card h2 { font-size: 1rem; }
    .admin-content > p .btn { width: 100%; }
    .btn { min-height: 38px; }
}
