/* Pharmacy Hugo Theme Stylesheet (Material Design Inspired) */
:root {
    --primary: #3f51b5;
    --primary-dark: #283593;
    --primary-light: #7986cb;
    --accent: #ff4081;
    --accent-hover: #f50057;
    --accent-light: #ff80ab;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #616161;
    --text-muted: #9e9e9e;
    --border: #e0e0e0;
    --elevation-1: 0 2px 5px rgba(0, 0, 0, 0.1);
    --elevation-2: 0 4px 12px rgba(0, 0, 0, 0.15);
    --elevation-3: 0 8px 24px rgba(0, 0, 0, 0.2);
    --radius: 4px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

/* Header & Navigation */
.site-header {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-link {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.brand-link:hover {
    color: #ffffff;
    opacity: 0.9;
}

.brand-tagline {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.25rem;
    position: relative;
    transition: color var(--transition);
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Main Layout */
.site-main-container {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.content-container {
    max-width: 1040px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Banner */
.banner-wrapper {
    position: relative;
    width: 100%;
    max-height: 360px;
    overflow: hidden;
    background-color: var(--primary-dark);
}

.banner-inner {
    position: relative;
    width: 100%;
    height: 320px;
}

.site-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(40, 53, 147, 0.4), rgba(40, 53, 147, 0.85));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    color: #ffffff;
}

.banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.banner-desc {
    font-size: 1.15rem;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Material Cards */
.material-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--elevation-1);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.article-card {
    padding: 1.75rem 2rem;
}

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

.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.meta-date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-icon {
    display: inline-block;
    vertical-align: middle;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.85rem;
}

.card-title a {
    color: var(--text-primary);
}

.card-title a:hover {
    color: var(--primary);
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.35rem 0.5rem;
    border-radius: 2px;
    transition: background-color var(--transition), color var(--transition);
}

.read-more-btn:hover {
    background-color: rgba(255, 64, 129, 0.08);
    color: var(--accent-hover);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    letter-spacing: 0.3px;
    transition: opacity var(--transition);
}

.badge-category {
    background-color: var(--primary);
    color: #ffffff;
}

.badge-category:hover {
    opacity: 0.85;
    color: #ffffff;
}

.badge-tag {
    background-color: rgba(255, 64, 129, 0.12);
    color: var(--accent);
}

.badge-tag:hover {
    background-color: rgba(255, 64, 129, 0.2);
    color: var(--accent-hover);
}

/* Single Article */
.single-article {
    padding: 2.5rem;
}

.article-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Table of Contents */
.article-toc {
    background-color: #fafafa;
    border-left: 3px solid var(--primary);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.toc-title {
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.article-toc nav ul {
    list-style: none;
    padding-left: 0.75rem;
}

.article-toc nav ul ul {
    padding-left: 1.25rem;
}

.article-toc a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.article-toc a:hover {
    color: var(--primary);
}

/* Markdown Content */
.markdown-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333333;
}

.markdown-body p {
    margin-bottom: 1.4rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: var(--text-primary);
    font-weight: 700;
    margin: 2rem 0 1rem;
    line-height: 1.35;
}

.markdown-body h1 { font-size: 1.85rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.markdown-body h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.markdown-body h3 { font-size: 1.25rem; }
.markdown-body h4 { font-size: 1.1rem; }

.markdown-body ul,
.markdown-body ol {
    margin: 1rem 0 1.4rem 1.75rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body blockquote {
    border-left: 4px solid var(--primary-light);
    background-color: #f8f9fa;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    color: #555555;
    font-style: italic;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem auto;
    display: block;
    box-shadow: var(--elevation-1);
}

.markdown-body code {
    font-family: Consolas, Monaco, "Courier New", monospace;
    background-color: #eee;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.88em;
    color: #c2185b;
}

.markdown-body pre {
    background-color: #263238;
    color: #eceff1;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    text-align: left;
}

.markdown-body th {
    background-color: #f0f2f5;
    font-weight: 600;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* Article Footer */
.article-footer {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.taxonomy-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.taxonomy-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Article Navigation */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.nav-prev,
.nav-next {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background-color: #fafafa;
    border: 1px solid var(--border);
    transition: background-color var(--transition), border-color var(--transition);
}

.nav-prev:hover,
.nav-next:hover {
    background-color: #ffffff;
    border-color: var(--primary);
}

.nav-next {
    text-align: right;
}

.nav-prev span,
.nav-next span {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.nav-prev strong,
.nav-next strong {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Pagination */
.pagination-nav {
    margin-top: 2.5rem;
}

.pagination-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    background-color: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--elevation-1);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color var(--transition), box-shadow var(--transition);
}

.pagination-btn:hover {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--elevation-2);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Archives Timeline */
.archives-wrapper {
    padding: 2.5rem;
}

.archives-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.archives-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.archive-year-group {
    margin-bottom: 2.5rem;
}

.year-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.35rem;
}

.year-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.year-badge {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.archive-items {
    list-style: none;
    padding-left: 0;
}

.archive-item {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    padding: 0.65rem 0;
    border-bottom: 1px dashed var(--border);
}

.archive-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 60px;
}

.archive-link {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.archive-link:hover {
    color: var(--primary);
}

/* Taxonomies & Term Chips */
.list-section {
    padding: 1rem 0;
}

.list-header {
    margin-bottom: 2rem;
}

.list-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.term-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.term-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--card-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    box-shadow: var(--elevation-1);
    color: var(--text-primary);
    font-weight: 500;
    transition: transform var(--transition), box-shadow var(--transition);
}

.term-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--elevation-2);
    color: var(--primary);
}

.term-count {
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.75rem;
    border-radius: 10px;
    padding: 0.1rem 0.5rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 1.05rem;
}

/* Floating Action Button (Back to Top) */
.fab-back-to-top {
    position: fixed;
    bottom: 2.25rem;
    right: 2.25rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elevation-2);
    z-index: 999;
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.fab-back-to-top:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: var(--elevation-3);
}

/* Footer */
.site-footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.footer-top a {
    color: rgba(255, 255, 255, 0.85);
}

.footer-top a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        height: auto;
        padding: 0.85rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .brand-link {
        font-size: 1.2rem;
    }

    .site-nav {
        gap: 0.85rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .banner-inner {
        height: 220px;
    }

    .banner-title {
        font-size: 1.75rem;
    }

    .banner-desc {
        font-size: 0.95rem;
    }

    .content-container {
        margin: 1.25rem auto;
        padding: 0 1rem;
    }

    .article-card {
        padding: 1.25rem 1.25rem;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .single-article {
        padding: 1.5rem 1.25rem;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .article-nav {
        grid-template-columns: 1fr;
    }

    .archives-wrapper {
        padding: 1.5rem 1.25rem;
    }

    .fab-back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 42px;
        height: 42px;
    }

    .footer-container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}
