/**
 * RxPharmacy Theme - Main Stylesheet
 *
 * @package RxPharmacy
 *
 * Structure:
 * 1. CSS Variables (defined in critical CSS inline)
 * 2. Base Styles
 * 3. Typography
 * 4. Layout
 * 5. Navigation
 * 6. Components
 * 7. Pages
 * 8. Footer
 * 9. Utilities
 * 10. Media Queries
 */

/* ==========================================================================
   2. Base Styles
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

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

a:hover,
a:focus {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing-md);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 var(--spacing-md);
}

ul, ol {
    margin: 0 0 var(--spacing-md);
    padding-left: var(--spacing-lg);
}

/* ==========================================================================
   4. Layout
   ========================================================================== */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.content-area {
    padding: var(--spacing-xl) 0;
}

.content-area.single-post {
    max-width: 800px;
}

/* Grid layouts */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

/* ==========================================================================
   5. Navigation
   ========================================================================== */

.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--spacing-md);
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a:focus,
.nav-menu .current-menu-item a {
    color: var(--color-primary);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--spacing-sm);
    cursor: pointer;
}

.menu-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    left: 0;
}

.menu-toggle-icon::before { top: -7px; }
.menu-toggle-icon::after { top: 7px; }

/* Header CTA */
.header-cta {
    display: flex;
    align-items: center;
}

.header-phone {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-primary);
    color: white;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
}

.header-phone:hover {
    background: var(--color-primary-dark);
    color: white;
    text-decoration: none;
}

/* ==========================================================================
   6. Components
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

.btn-secondary:hover {
    background: #218838;
    border-color: #218838;
    color: white;
    text-decoration: none;
}

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

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}

/* Post Cards */
.post-card {
    background: var(--color-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.post-card-content {
    padding: var(--spacing-md);
}

.post-card .entry-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

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

.post-card .entry-title a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.post-card .entry-summary {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.post-card .read-more {
    font-weight: 500;
}

/* Service Cards */
.service-card {
    background: var(--color-bg);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.service-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.service-description {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.service-link {
    font-weight: 500;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: var(--spacing-md) 0;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.breadcrumbs a {
    color: var(--color-text-light);
}

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

.breadcrumbs .sep {
    margin: 0 var(--spacing-xs);
}

.breadcrumbs .current {
    color: var(--color-text);
}

/* Entry Styles */
.entry-header {
    margin-bottom: var(--spacing-lg);
}

.entry-title {
    margin-bottom: var(--spacing-sm);
}

.entry-meta {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.entry-meta span {
    margin-right: var(--spacing-md);
}

.entry-content {
    line-height: 1.7;
}

.entry-content p {
    margin-bottom: var(--spacing-md);
}

.entry-footer {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid #eee;
}

/* ==========================================================================
   7. Pages - Hero Section
   ========================================================================== */

.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: white;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.hero-cta {
    font-size: 1.125rem;
}

/* Services Section */
.services-section {
    padding: var(--spacing-xl) 0;
    background: var(--color-bg-alt);
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

/* About Section */
.about-section {
    padding: var(--spacing-xl) 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.about-features {
    list-style: none;
    padding: 0;
    margin: var(--spacing-lg) 0;
}

.about-features li {
    padding: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
    position: relative;
}

.about-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-secondary);
    font-weight: bold;
}

/* Contact Section */
.contact-section {
    padding: var(--spacing-xl) 0;
    background: var(--color-bg-alt);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.contact-item {
    margin-bottom: var(--spacing-md);
}

.contact-item strong {
    display: block;
    margin-bottom: var(--spacing-xs);
}

/* ==========================================================================
   8. Footer
   ========================================================================== */

.site-footer {
    background: #1a1a1a;
    color: #ccc;
}

/* Footer Main Section */
.footer-main {
    padding: 60px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-column {
    min-width: 0;
}

.footer-heading {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--color-primary);
}

/* Opening Hours */
.footer-column .opening-hours {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #bbb;
}

/* Contact Info */
.footer-contact-info .contact-item {
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-contact-info .contact-item strong {
    color: white;
    display: block;
    margin-bottom: 4px;
}

.footer-contact-info .contact-item a {
    color: #bbb;
    transition: color 0.2s;
}

.footer-contact-info .contact-item a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.footer-contact-info address {
    font-style: normal;
}

/* Footer Links List */
.footer-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links-list li {
    margin-bottom: 10px;
}

.footer-links-list a {
    color: #bbb;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links-list a:hover {
    color: white;
    padding-left: 5px;
}

/* Footer Social Links */
.footer-social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #333;
    border-radius: 50%;
    color: white;
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--color-primary);
    transform: translateY(-3px);
    text-decoration: none;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Pharmacy Info */
.pharmacy-info {
    font-size: 0.85rem;
    color: #888;
    margin-top: 16px;
}

.pharmacy-info p {
    margin-bottom: 6px;
}

.pharmacy-info strong {
    color: #aaa;
}

/* Footer Bottom */
.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid #333;
    background: #151515;
}

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

.copyright {
    font-size: 0.875rem;
    color: #888;
}

.footer-credits a {
    color: #888;
    font-size: 0.875rem;
    text-decoration: none;
}

.footer-credits a:hover {
    color: white;
}

/* Legacy Footer Widgets Support */
.footer-widgets {
    padding: var(--spacing-xl) 0;
}

.footer-column .widget-title {
    color: white;
    margin-bottom: var(--spacing-md);
}

.footer-column a {
    color: #ccc;
}

.footer-column a:hover {
    color: white;
}

.footer-info {
    padding: var(--spacing-lg) 0;
    border-top: 1px solid #333;
}

.footer-info-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--spacing-md);
}

.footer-menu a {
    color: #ccc;
    font-size: 0.875rem;
}

.footer-menu a:hover {
    color: white;
}

/* Social Links (legacy) */
.social-links {
    display: flex;
    gap: var(--spacing-sm);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;
    color: white;
    transition: background 0.2s ease;
}

.social-links a:hover {
    background: var(--color-primary);
    text-decoration: none;
}

/* ==========================================================================
   9. Utilities
   ========================================================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

.skip-link:focus {
    background-color: var(--color-primary);
    color: white;
    padding: var(--spacing-md);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100000;
}

/* Opening Hours */
.opening-hours {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==========================================================================
   10. Media Queries
   ========================================================================== */

@media (max-width: 992px) {
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Navigation */
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        gap: 0;
    }

    .nav-menu.is-active {
        display: flex;
    }

    .nav-menu a {
        padding: var(--spacing-md);
        border-bottom: 1px solid #eee;
    }

    /* Header */
    .header-inner {
        flex-wrap: wrap;
    }

    .header-phone .phone-number {
        display: none;
    }

    /* Hero */
    .hero-section {
        min-height: 300px;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-main {
        padding: 40px 0 30px;
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }

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

    .services-grid {
        grid-template-columns: 1fr;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .menu-toggle,
    .skip-link {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}
