/* ═══════════════════════════════════════════════════
   Aptila Biotech — Modern Enterprise Stylesheet
   ═══════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-base);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-link-hover);
}

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

h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h2 {
    font-size: clamp(1.35rem, 3vw, 2rem);
}

h3 {
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
}

p {
    margin-bottom: 1rem;
}

ul,
ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* ─── Layout ───────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 991px) {

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {

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

/* ─── Header ───────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 100;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.header.header-transparent {
    background: transparent;
    border-bottom-color: transparent;
}

.header.header-scrolled {
    background: var(--color-white);
    border-bottom-color: var(--color-gray-200);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 52px;
    width: auto;
}

.logo-inverted {
    display: none;
}

.header-transparent .logo-default {
    display: none;
}

.header-transparent .logo-inverted {
    display: block;
}

.header-transparent.header-scrolled .logo-default {
    display: block;
}

.header-transparent.header-scrolled .logo-inverted {
    display: none;
}

/* ─── Desktop Nav ──────────────────────────────── */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-desktop a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-family-base);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-gray-700);
    text-decoration: none;
    padding: 6px 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-desktop a svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.nav-desktop a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-blue);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition-base);
}

.nav-desktop a:hover {
    color: var(--color-navy);
}

.nav-desktop a:hover::after {
    transform: scaleX(1);
}

.nav-desktop a.active {
    color: var(--color-navy);
}

.nav-desktop a.active::after {
    transform: scaleX(1);
}

/* Header-transparent nav links */
.header-transparent .nav-desktop a {
    color: rgba(255, 255, 255, 0.85);
}

.header-transparent .nav-desktop a:hover {
    color: var(--color-white);
}

.header-transparent .nav-desktop a::after {
    background: var(--color-white);
}

.header-transparent.header-scrolled .nav-desktop a {
    color: var(--color-gray-700);
}

.header-transparent.header-scrolled .nav-desktop a:hover {
    color: var(--color-navy);
}

.header-transparent.header-scrolled .nav-desktop a::after {
    background: var(--color-blue);
}

.nav-desktop .nav-btn {
    background: var(--color-navy);
    color: var(--color-white) !important;
    padding: 8px 22px;
    border-radius: var(--button-radius);
    border: 1px solid var(--color-navy);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-desktop .nav-btn::after {
    display: none;
}

.nav-desktop .nav-btn:hover {
    background: var(--color-navy-light);
    border-color: var(--color-navy-light);
    color: var(--color-white) !important;
}

.header-transparent .nav-desktop .nav-btn {
    background: var(--color-navy);
    border-color: var(--color-navy);
}

.header-transparent .nav-desktop .nav-btn:hover {
    background: var(--color-navy-light);
    border-color: var(--color-navy-light);
}

.header-transparent.header-scrolled .nav-desktop .nav-btn {
    background: var(--color-navy);
    border-color: var(--color-navy);
}

.header-transparent.header-scrolled .nav-desktop .nav-btn:hover {
    background: var(--color-navy-light);
    border-color: var(--color-navy-light);
}

/* ─── Hamburger ────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-gray-700);
    border-radius: 1px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.header-transparent .hamburger span {
    background: var(--color-white);
}

.header-transparent.header-scrolled .hamburger span {
    background: var(--color-gray-700);
}

@media (max-width: 767px) {
    .nav-desktop {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}

/* ─── Mobile Menu ──────────────────────────────── */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--color-white);
    z-index: 200;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.mobile-menu.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-top {
    display: flex;
    justify-content: flex-end;
    padding: 20px 24px;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray-700);
    padding: 4px;
}

.mobile-menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.mobile-menu-nav a {
    font-family: var(--font-family-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-gray-900);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.mobile-menu-nav a:hover {
    color: var(--color-blue);
}

.mobile-menu-bottom {
    padding: 24px;
    display: flex;
    justify-content: center;
}

body.menu-open {
    overflow: hidden;
}

/* ─── Hero ─────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-blue) 100%);
    color: var(--color-white);
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.hero-tall {
    min-height: 480px;
    display: flex;
    align-items: center;
}

.hero-tall .hero-content {
    padding: 40px 0;
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    color: var(--color-white);
    margin-bottom: 16px;
    font-weight: 700;
}

.hero p,
.hero .hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 24px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    border-radius: var(--button-radius);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: var(--color-white);
    background: transparent;
    transition: background var(--transition-base), border-color var(--transition-base);
    text-decoration: none;
}

.hero-buttons .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-white);
    color: var(--color-white);
}

.hero-buttons .btn svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    flex-shrink: 0;
}

/* ─── Sections ─────────────────────────────────── */
.section {
    padding: var(--section-padding) 0;
}

.section-alt {
    background: var(--color-off-white);
}

.section-heading {
    margin-bottom: 40px;
}

.section-heading h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    position: relative;
    display: inline-block;
}

.section-heading h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--color-blue);
    margin-top: 12px;
    border-radius: 2px;
}

/* ─── Cards ────────────────────────────────────── */
.card {
    background: var(--color-white);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body h2,
.card-body h3 {
    margin-bottom: 8px;
}

.card-body h3 {
    font-size: 1.2rem;
}

.card-body h2 a,
.card-body h3 a {
    color: var(--color-gray-900);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.card-body h2 a:hover,
.card-body h3 a:hover {
    color: var(--color-blue);
}

.card-body p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.card-thumbnail {
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.card:hover .card-thumbnail img {
    transform: scale(1.03);
}

.card-thumbnail-placeholder {
    background:
        url('/images/logo/Aptila-ring-only-placeholder.svg') center / contain no-repeat,
        linear-gradient(135deg, var(--color-navy) 0%, var(--color-blue) 100%);
}

.card-thumbnail-placeholder a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Highlight cards (no image) */
.card-highlight {
    border-top: 3px solid var(--color-blue);
}

.card-highlight .card-body {
    padding: 28px 24px;
}

.card-highlight h2 {
    font-size: 1.2rem;
    color: var(--color-navy);
}

/* ─── News Row (blog listing) ──────────────────── */
.post-row {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--color-gray-200);
}

.post-row:first-child {
    padding-top: 0;
}

.post-row-thumbnail {
    flex-shrink: 0;
    width: 200px;
    border-radius: var(--card-radius);
    overflow: hidden;
}

.post-row-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--card-radius);
}

.post-row-content {
    flex: 1;
    min-width: 0;
}

.post-row-content h2 {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.post-row-content h2 a {
    color: var(--color-gray-900);
    text-decoration: none;
}

.post-row-content h2 a:hover {
    color: var(--color-blue);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.post-meta .author {
    font-weight: 500;
}


.post-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.post-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.post-categories a {
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.post-categories a:hover {
    background: var(--color-blue);
    color: var(--color-white);
}

@media (max-width: 575px) {
    .post-row {
        flex-direction: column;
        gap: 12px;
    }

    .post-row-thumbnail {
        width: 100%;
    }
}

/* ─── Blog Layout ──────────────────────────────── */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
}

@media (max-width: 767px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ─── Sidebar ──────────────────────────────────── */
.sidebar h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--color-gray-900);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 8px;
}

.sidebar ul li a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.sidebar ul li a:hover {
    color: var(--color-blue);
}

.sidebar ul li a.active {
    color: var(--color-blue);
    font-weight: 500;
}

/* ─── Team Cards ───────────────────────────────── */
.team-card {
    text-align: center;
}

.team-card .card-thumbnail {
    aspect-ratio: 1;
    border-radius: 50%;
    width: 160px;
    height: 160px;
    margin: 24px auto 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.team-card .card-thumbnail img {
    border-radius: 50%;
}

.team-card .card-body {
    text-align: center;
}

.team-card h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.team-card .team-title {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.team-card .team-links {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.team-card .team-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.team-card .team-links a svg {
    width: 18px;
    height: 18px;
}

.team-card .team-links a:hover {
    color: var(--color-blue);
    background: rgba(0, 102, 204, 0.08);
}

/* ─── Content (prose) ──────────────────────────── */
.content {
    max-width: 720px;
}

.content h1 {
    margin-bottom: 16px;
}

.content h2 {
    margin-top: 32px;
    margin-bottom: 12px;
}

.content h3 {
    margin-top: 24px;
    margin-bottom: 10px;
}

.content p {
    margin-bottom: 16px;
}

.content ul,
.content ol {
    margin-bottom: 16px;
}

.content img {
    border-radius: var(--card-radius);
    margin: 16px 0;
}

.content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.content a:hover {
    text-decoration-color: var(--color-blue);
}

.content blockquote {
    border-left: 3px solid var(--color-blue);
    padding: 12px 20px;
    margin: 16px 0;
    color: var(--color-text-muted);
    background: var(--color-off-white);
    border-radius: 0 var(--card-radius) var(--card-radius) 0;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.content th,
.content td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.content th {
    font-weight: 600;
    color: var(--color-gray-900);
    background: var(--color-off-white);
}

.content code {
    font-family: var(--font-family-monospace);
    font-size: 0.9em;
    background: var(--color-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
}

.content pre {
    background: var(--color-gray-900);
    color: var(--color-gray-100);
    padding: 20px;
    border-radius: var(--card-radius);
    overflow-x: auto;
    margin: 16px 0;
}

.content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ─── Post Single ──────────────────────────────── */
.post-header {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 24px;
}

.post-header h1 {
    margin-bottom: 8px;
}

.post-header .post-description-header {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.post-date {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--color-gray-200);
}

/* ─── Social Icons ─────────────────────────────── */
.social {
    display: flex;
    gap: 16px;
}

.social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--color-gray-500);
    background: var(--color-gray-100);
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.social a:hover {
    color: var(--color-white);
    background: var(--color-blue);
    transform: translateY(-2px);
}

.social a svg {
    width: 18px;
    height: 18px;
}

/* ─── Footer ───────────────────────────────────── */
.footer {
    background: var(--color-off-white);
    padding: 48px 0 24px;
    border-top: 1px solid var(--color-gray-200);
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-brand img {
    height: 52px;
    width: auto;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-blue);
}

.footer-badge img {
    height: 64px;
    width: auto;
    opacity: 0.7;
}

.footer-bottom {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-gray-200);
}

/* ─── Bottom Bar ───────────────────────────────── */
.bottom-bar {
    background: var(--color-navy);
    color: rgba(255, 255, 255, 0.6);
    padding: 16px 0;
    font-size: 0.85rem;
}

.bottom-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.bottom-bar a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.bottom-bar a:hover {
    color: var(--color-white);
}

.bottom-bar .copyright {
    color: rgba(255, 255, 255, 0.5);
}

/* ─── Buttons (general) ───────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--color-blue);
    color: var(--color-white);
    border: none;
    border-radius: var(--button-radius);
    font-family: var(--font-family-base);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
    background: var(--color-navy-light);
    transform: translateY(-1px);
    color: var(--color-white);
}

/* ─── Page (static page content) ───────────────── */
.page-content {
    padding-top: 40px;
    padding-bottom: var(--section-padding);
}

/* ─── Utilities ────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── Responsive: mobile hero ──────────────────── */
@media (max-width: 767px) {
    :root {
        --section-padding: 48px;
    }

    .hero {
        padding-top: calc(var(--header-height) + 32px);
        padding-bottom: 40px;
    }

    .hero-tall {
        min-height: auto;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

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

    .post-header {
        padding-top: calc(var(--header-height) + 20px);
    }
}

@media (max-width: 575px) {
    .container {
        padding: 0 16px;
    }

    .section-heading {
        margin-bottom: 24px;
    }
}