:root {
    --ps-green: #2d7a3e;
    --ps-green-dark: #1f5b2d;
    --ps-green-light: #e8f5e9;
    --ps-green-subtle: #c8e6c9;
    --ps-gray: #323f48;
    --ps-gray-strong: #4a4f57;
    --ps-gray-light: #6c757d;
    --ps-gray-pale: #f3f3f3;
    --ps-white: #ffffff;
    --ps-warning: #ffc107;
    --ps-accent: #4caf50;
    --ps-gold: #f59e0b;
    --ps-gold-light: #fef3c7;
}

html {
    scroll-behavior: smooth;
}

@font-face {
    font-family: "bootstrap-icons";
    src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/fonts/bootstrap-icons.woff2") format("woff2"),
         url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/fonts/bootstrap-icons.woff") format("woff");
    font-display: swap;
}

body {
    padding-top: 5em;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.2em;
    line-height: 1.5;
    color: var(--ps-gray);
    background-color: var(--ps-white);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ps-green);
    color: var(--ps-white);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-weight: 500;
    border-radius: 0 0 4px 0;
    opacity: 0;
    pointer-events: none;
    transition: top 0.2s, opacity 0.2s;
}

.skip-link:focus {
    top: 0;
    opacity: 1;
    pointer-events: auto;
    outline: 2px solid var(--ps-warning);
    outline-offset: 2px;
}

#main-content:focus {
    outline: none;
}

.content-px {
    padding-left: 10%;
    padding-right: 10%;
}

h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: .5em;
    scroll-margin-top: 5rem;
}
/* Links */
a {
    text-decoration: none;
    font-weight: 500;
    color: var(--ps-green);
}

a:hover {
    text-decoration: underline;
}

/* Links inside inline code */
code a,
a code {
    color: var(--ps-green);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

code a:hover,
a code:hover {
    color: var(--ps-green-dark);
    text-decoration-style: solid;
}

.nav-link a {
    text-decoration: none;
    font-weight: 500;
    color: var(--ps-gray);
}

.nav-link a:hover {
    text-decoration: none;
    color: var(--ps-green);
}

.bg-gray {
    background: var(--ps-gray-pale);
}

.bg-white {
    background: white;
}

.text-green {
    color: var(--ps-green);
}

.text-muted-strong {
    color: var(--ps-gray-strong) !important;
}

.badge-strong {
    color: #1f1f1f;
    font-weight: 600;
}

/* Custom button */
button {
    background: var(--ps-green);
    color: var(--ps-white);
    border-radius: 5px;
    border: none;
    padding: 0.3em 0.6em;
}

button:hover {
    background: var(--ps-green-dark);
    color: var(--ps-white);
}

/* Custom pagination */
.custom-pagination .page-link {
    color: var(--ps-green);
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 0 4px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-pagination .page-link:hover {
    background-color: var(--ps-green-light);
    border-color: var(--ps-green);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(45, 122, 62, 0.2);
}

.custom-pagination .active .page-link {
    background-color: var(--ps-green);
    border-color: var(--ps-green);
    color: var(--ps-white);
    box-shadow: 0 2px 8px rgba(45, 122, 62, 0.3);
}

.custom-pagination .page-item:first-child .page-link,
.custom-pagination .page-item:last-child .page-link {
    font-weight: 600;
}

.pagination {
    gap: 0;
}

/* Smooth scroll with offset for article list */
#article-list {
    scroll-margin-top: 100px;
}

/* Card Hover Effects - Elevation with Shadow */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: none;
}

.card:hover:not(.getting-started-card) {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Getting Started Card - No Hover Effect */
.getting-started-card {
    transition: none !important;
}

.getting-started-card:hover {
    transform: none !important;
}

/* Remove pointer cursor for featured card */
.featured-card-elevated .card:hover {
    cursor: default;
}

.card a {
    transition: color 0.3s ease;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card .py-3 {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 24px !important;
}

.card-title {
    min-height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 1.1rem;
    line-height: 1.4;
}

.card-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Navigation Bar Effects */
.navbar {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    min-height: 76px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar .search-form {
    flex: 0 0 auto;
    align-items: center;
}

.search-input-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.search-form.search-expanded .search-input-wrapper {
    width: 240px;
}

.search-toggle {
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.search-toggle:hover {
    color: var(--ps-green) !important;
}

.navbar .stork-output {
    transform: translateY(0.5rem);
}

.navbar .stork-input {
    width: 100%;
}

.navbar .search-form .stork-wrapper {
    width: 100%;
}

@media (max-width: 991.98px) {
    .navbar .search-form {
        width: 100%;
        flex: 1 1 auto;
        margin-top: 1rem;
    }

    .search-input-wrapper {
        width: 100% !important;
    }

    .search-toggle {
        display: none !important;
    }
}

.navbar.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98) !important;
}

.navbar-brand {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.navbar-brand img {
    transition: filter 0.3s ease;
}

.navbar-brand:hover img {
    filter: brightness(1.1);
}

.nav-link a {
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 4px;
}

.nav-link a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ps-green), var(--ps-accent));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

/* Featured Article Card Elevated Style */

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

.navbar-toggler {
    border: none;
    transition: transform 0.3s ease;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 136, 0, 0.25);
}

.navbar-toggler:hover {
    transform: scale(1.1);
}

.stork-input {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0.5em 1em;
    height: 2.5rem;
    line-height: 1.2;
    width: 100%;
}

.stork-input:focus {
    outline: none;
    border-color: var(--ps-green);
    box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.1);
}

/* ========================================
   FEATURED HERO ARTICLE STYLES
   ======================================== */

/* (unused .featured-hero styles removed) */

/* ========================================
   GETTING STARTED GUIDE STYLES
   ======================================== */

.getting-started-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.getting-started-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.getting-started-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.getting-started-link:hover {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-color: var(--ps-green);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(45, 122, 62, 0.15);
    color: inherit;
}

.getting-started-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2D7A3E 0%, #1a4d25 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(45, 122, 62, 0.2);
}

.getting-started-copy .fw-semibold {
    display: block;
}

.getting-started-link:hover .getting-started-number {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(45, 122, 62, 0.3);
}

.getting-started-link:hover i.bi-chevron-right {
    transform: translateX(4px);
    color: #2D7A3E !important;
}

.getting-started-link i.bi-chevron-right {
    transition: all 0.3s ease;
}

/* Featured section adjustments */
.featured-section .card:first-child {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-section .card:first-child:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.featured-section .getting-started-card {
    transition: none;
}

.featured-section .getting-started-card:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

@media (max-width: 991.98px) {
    .getting-started-card {
        margin-top: 2rem;
    }
    
    .getting-started-link {
        padding: 0.75rem;
    }
    
    .getting-started-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* Footer */
.site-footer {
    background-color: #f5faf6;
    color: #35594a;
    font-size: 0.95rem;
}

.site-footer a {
    color: #1f5b2d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover,
.site-footer a:focus {
    color: #15411f;
    text-decoration: underline;
}

.site-footer .footer-primary {
    background: radial-gradient(circle at top left, rgba(45, 122, 62, 0.07), transparent 60%);
    padding-left: min(2rem, 5vw);
    padding-right: min(2rem, 5vw);
}

.site-footer .footer-secondary {
    background-color: #2d7a3e;
}

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

.site-footer .footer-secondary a:hover,
.site-footer .footer-secondary a:focus {
    color: #ffffff;
}

.site-footer .footer-links li + li {
    margin-top: 0.25rem;
}

.site-footer .footer-primary .row {
    align-items: center;
}

.card-flat,
.card-flat:hover {
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
}

.portrait-static {
    transition: none !important;
    transform: none !important;
    max-width: 220px;
    width: 100%;
    height: auto;
}

.hero-logo {
    max-width: 280px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
}

.footer-logo {
    border: 1px solid rgba(45, 122, 62, 0.2);
    border-radius: 0.75rem;
    padding: 0.35rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.8);
}

.footer-description {
    font-size: 1rem;
    line-height: 1.5;
}

/* ========================================
   BACK TO TOP BUTTON (Global)
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ps-green-subtle);
    color: var(--ps-green-dark);
    border: 2px solid var(--ps-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s, color 0.3s;
    z-index: 2000;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--ps-green-dark);
    color: var(--ps-white);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(45, 122, 62, 0.3);
}
