/* 
 * IT Service Provider Website - Responsive Styles
 * Compatible with Safari, Chrome, Edge, Firefox
 */

/* CSS Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Accessibility - Skip Navigation Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* Accessibility - Visually Hidden (Screen Reader Only) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Accessibility - Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

html {
    width: 100%;
    max-width: 100%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================
   Site Header & Navigation
   ============================ */
.site-header {
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Main Navigation */
.main-nav {
    display: flex;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-list a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    border-radius: var(--radius);
    transition: background-color var(--transition), color var(--transition);
}

.nav-list a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.nav-list a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Desktop Navigation - Always show nav and hide hamburger */
@media (min-width: 901px) {
    .hamburger-btn {
        display: none !important;
    }
    
    .main-nav {
        display: flex !important;
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
    }
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.4rem;
    gap: 5px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.08);
}

.hamburger-btn:active {
    transform: scale(0.95);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 4px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation */
@media (max-width: 900px) {
    .hamburger-btn {
        display: flex !important;
    }
    
    .main-nav {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        box-shadow: var(--shadow-md);
        padding: 0;
        flex-direction: column;
        z-index: 999;
        width: 100%;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .nav-list li {
        width: 100%;
    }
    
    .nav-list a {
        padding: 1rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        display: block;
        text-align: left;
    }
    
    .nav-list li:last-child a {
        border-bottom: none;
    }
}

/* Page Header (for inner pages) */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 3rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Legacy header styles (for backwards compatibility) */
header:not(.site-header) {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

header:not(.site-header) h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header:not(.site-header) p {
    font-size: 1rem;
    opacity: 0.9;
}

/* ============================
   Hero Section
   ============================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 5rem 1rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border-color: white;
}

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

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* ============================
   Services Section
   ============================ */
.services-preview,
.why-us,
.cta-section {
    padding: 4rem 0;
}

.services-preview {
    background-color: var(--bg-color);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.service-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.service-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.section-cta {
    text-align: center;
    margin-top: 2rem;
}

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

.section-cta .btn-primary:hover {
    background-color: var(--primary-hover);
}

/* ============================
   Why Us Section
   ============================ */
.why-us {
    background-color: var(--card-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.feature {
    padding: 1.5rem;
}

.feature-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature-text {
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* ============================
   CTA Section
   ============================ */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* ============================
   Site Footer
   ============================ */
.site-footer {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 3rem 0 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul a {
    color: #9ca3af;
    text-decoration: none;
    transition: color var(--transition);
}

.footer-section ul a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom p {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Main Content */
main {
    padding: 1.5rem 0;
}

/* Channel Section */
.channel-section {
    margin-bottom: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.channel-header {
    background: linear-gradient(to right, #f3f4f6, #ffffff);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.channel-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.channel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

/* News Items */
.news-list {
    list-style: none;
}

.news-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background-color: #f9fafb;
}

.news-item a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.375rem;
    transition: color var(--transition), text-decoration-thickness var(--transition);
}

.news-item a:hover {
    color: var(--primary-hover);
    text-decoration-thickness: 2px;
}

.news-item a:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 2px;
}

/* Just In Tag */
.just-in-tag {
    display: inline-block;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.375rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.news-item.just-in {
    background-color: rgba(239, 68, 68, 0.05);
    border-left: 3px solid #ef4444;
}

/* Read article state */
.news-item.read {
    background-color: #f8f9fa;
    opacity: 0.8;
}

.news-item.read a {
    color: #6b7280;
    text-decoration-color: #9ca3af;
}

.news-item.read a:hover {
    color: #4b5563;
}

.read-tag {
    display: inline-block;
    background-color: #6b7280;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-bottom: 0.375rem;
}

/* Thumbnail Styles */
.news-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.news-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border-color);
}

.news-thumbnail.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.no-image-icon {
    font-size: 1.5rem;
    opacity: 0.5;
    filter: grayscale(1);
}

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

.news-item:hover .news-thumbnail img {
    transform: scale(1.05);
}

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

@media (max-width: 575px) {
    .news-item {
        flex-direction: column;
    }
    
    .news-thumbnail {
        width: 100%;
        height: 160px;
    }
    
    .news-thumbnail.no-image {
        display: none;
    }
}

.news-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.news-date::before {
    content: '📅';
    font-size: 0.75rem;
}

/* Empty/Error States */
.empty-state,
.error-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.error-state {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 0.5rem;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* Cache Info */
.cache-info {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cache-info::before {
    content: 'ℹ️';
}

/* Channel Filter */
.filter-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.filter-container label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.channel-dropdown {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 200px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.channel-dropdown:hover {
    border-color: var(--primary-color);
}

.channel-dropdown:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
}

@media (max-width: 575px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .channel-dropdown {
        width: 100%;
        min-width: unset;
    }
}

/* Refresh Button */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition);
}

.refresh-btn:hover {
    background: var(--primary-hover);
}

/* ============================
   About Page Styles
   ============================ */
.about-content {
    padding: 3rem 0;
}

.about-grid {
    max-width: 800px;
    margin: 0 auto;
}

.about-text h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ============================
   Contact Page Styles
   ============================ */
.contact-content {
    padding: 3rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-info h2,
.contact-form-wrapper h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-info > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-item h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.contact-item p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

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

.contact-item a:hover {
    text-decoration: underline;
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-form .form-group {
    margin-bottom: 1.25rem;
}

.contact-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.contact-form .btn:hover {
    background-color: var(--primary-hover);
}

/* Responsive Breakpoints */

/* Small devices (phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        padding: 1.5rem;
    }
    
    header:not(.site-header) {
        padding: 2.5rem 1.5rem;
    }
    
    header:not(.site-header) h1 {
        font-size: 2rem;
    }
    
    .hero h1 {
        font-size: 2.75rem;
    }
    
    .page-header h1 {
        font-size: 2.25rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
    
    header:not(.site-header) {
        padding: 3rem 2rem;
    }
    
    header:not(.site-header) h1 {
        font-size: 2.25rem;
    }
    
    .hero {
        padding: 6rem 2rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .page-header {
        padding: 4rem 2rem;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .channel-header h2 {
        font-size: 1.375rem;
    }
    
    .news-item {
        padding: 1.25rem 1.5rem;
    }
    
    .news-item a {
        font-size: 1.0625rem;
    }
    
    .services-preview,
    .why-us,
    .cta-section {
        padding: 5rem 0;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    header:not(.site-header) h1 {
        font-size: 2.5rem;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
}

/* Print Styles */
@media print {
    header {
        background: white;
        color: black;
        box-shadow: none;
    }
    
    .channel-section {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .news-item a {
        color: black;
    }
    
    .news-item a::after {
        content: ' (' attr(href) ')';
        font-size: 0.75rem;
        color: #666;
    }
    
    .refresh-btn,
    .filter-container {
        display: none;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3b82f6;
        --primary-hover: #60a5fa;
        --text-color: #f9fafb;
        --text-muted: #9ca3af;
        --bg-color: #111827;
        --card-bg: #1f2937;
        --border-color: #374151;
    }
    
    .site-header {
        background: #1f2937;
        border-bottom: 1px solid #374151;
    }
    
    .logo-text {
        color: #60a5fa;
    }
    
    .nav-list a {
        color: #f9fafb;
    }
    
    .nav-list a:hover {
        background-color: #374151;
    }
    
    .hamburger-line {
        background-color: #f9fafb;
    }

    .hamburger-btn {
        border-color: #4b5563;
    }
    
    .main-nav {
        background: #1f2937;
    }
    
    .service-card {
        background: #1f2937;
    }
    
    .channel-header {
        background: linear-gradient(to right, #374151, #1f2937);
    }
    
    .news-item:hover {
        background-color: #374151;
    }
    
    .cache-info {
        background: #064e3b;
        border-color: #065f46;
        color: #a7f3d0;
    }
    
    .channel-dropdown {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    }
    
    .news-item.just-in {
        background-color: rgba(239, 68, 68, 0.15);
    }
    
    .news-thumbnail.no-image {
        background: linear-gradient(135deg, #374151, #4b5563);
    }
    
    .services-preview {
        background-color: #111827;
    }
    
    .why-us {
        background-color: #1f2937;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ee;
        --border-color: #000;
    }
    
    .channel-section {
        border: 2px solid black;
    }
    
    .news-item a {
        text-decoration: underline;
    }
}

/* ============================
   Iframe Responsive Styles
   ============================ */

/*
 * To enable iframe mode via JavaScript, add this to your page:
 * 
 * <script>
 *   if (window !== window.top) {
 *     document.documentElement.classList.add('in-iframe');
 *   }
 * </script>
 */

/* Base iframe styles - when embedded */
.in-iframe,
.in-iframe body {
    width: 100%;
    height: auto;
    min-height: auto;
    overflow-x: hidden;
}

.in-iframe .container,
.in-iframe .section-container,
.in-iframe .header-container,
.in-iframe .footer-container {
    max-width: 100%;
    padding: 0.5rem;
}

/* Compact header in iframe */
.in-iframe .site-header {
    position: relative;
    top: auto;
}

.in-iframe .header-container {
    height: auto;
    min-height: 50px;
    padding: 0.5rem;
    flex-wrap: wrap;
}

.in-iframe .logo-text {
    font-size: 1rem;
}

.in-iframe .logo-icon {
    font-size: 1.25rem;
}

/* Compact navigation in iframe - always visible, horizontal */
.in-iframe .hamburger-btn {
    display: none !important;
}

.in-iframe .main-nav {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex !important;
    flex-direction: row;
    width: auto;
}

.in-iframe .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.in-iframe .nav-list a {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-bottom: none;
}

.in-iframe .nav-list li:last-child a {
    border-bottom: none;
}

/* Hero section compact in iframe */
.in-iframe .hero {
    padding: 2rem 1rem;
}

.in-iframe .hero h1 {
    font-size: 1.5rem;
}

.in-iframe .hero p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.in-iframe .hero-buttons {
    gap: 0.5rem;
}

.in-iframe .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Page header compact */
.in-iframe .page-header {
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
}

.in-iframe .page-header h1 {
    font-size: 1.5rem;
}

.in-iframe .page-header p {
    font-size: 0.9375rem;
}

/* Section titles compact */
.in-iframe .section-title {
    font-size: 1.5rem;
}

.in-iframe .section-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Services grid compact */
.in-iframe .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.in-iframe .service-card {
    padding: 1rem;
}

.in-iframe .service-icon {
    font-size: 2rem;
}

.in-iframe .service-card h3 {
    font-size: 1rem;
}

/* Features grid compact */
.in-iframe .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.in-iframe .feature {
    padding: 0.75rem;
}

.in-iframe .feature-number {
    font-size: 2rem;
}

.in-iframe .feature-text {
    font-size: 0.9375rem;
}

/* Channel/news section compact */
.in-iframe .channel-section {
    margin-bottom: 1rem;
}

.in-iframe .channel-header {
    padding: 0.75rem 1rem;
}

.in-iframe .channel-header h2 {
    font-size: 1rem;
}

.in-iframe .channel-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

.in-iframe .news-item {
    padding: 0.75rem 1rem;
    flex-direction: column;
}

.in-iframe .news-thumbnail {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.in-iframe .news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.in-iframe .news-item a {
    font-size: 0.9375rem;
}

.in-iframe .news-description {
    font-size: 0.8125rem;
}

.in-iframe .news-date {
    font-size: 0.6875rem;
}

/* Filter compact */
.in-iframe .filter-container {
    padding: 0.75rem;
    gap: 0.5rem;
    flex-direction: column;
    align-items: stretch;
}

.in-iframe .channel-dropdown {
    width: 100%;
    min-width: unset;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9375rem;
}

/* Footer compact in iframe */
.in-iframe .site-footer {
    padding: 1.5rem 0 0;
}

.in-iframe .footer-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.in-iframe .footer-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.in-iframe .footer-bottom {
    padding: 1rem 0;
}

/* Contact compact */
.in-iframe .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.in-iframe .contact-form-wrapper {
    padding: 1rem;
}

/* CTA section compact */
.in-iframe .cta-section {
    padding: 2rem 0;
}

.in-iframe .cta-section h2 {
    font-size: 1.5rem;
}

.in-iframe .cta-section p {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

/* Hide non-essential elements in iframe */
.in-iframe .skip-link {
    display: none;
}

/* ============================
   Small Iframe / Widget Mode
   (for iframes under 400px wide)
   ============================ */
@media (max-width: 400px) {
    .in-iframe .header-container {
        flex-direction: column;
        height: auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .in-iframe .main-nav {
        position: relative;
        top: auto;
        width: 100%;
        display: flex;
    }
    
    .in-iframe .nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .in-iframe .nav-list a {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .in-iframe .hamburger-btn {
        display: none;
    }
    
    .in-iframe .hero h1 {
        font-size: 1.25rem;
    }
    
    .in-iframe .hero p {
        font-size: 0.875rem;
    }
    
    .in-iframe .features-grid {
        grid-template-columns: 1fr;
    }
    
    .in-iframe .service-card {
        padding: 0.75rem;
    }
    
    .in-iframe .service-icon {
        font-size: 1.5rem;
    }
    
    .in-iframe .news-thumbnail {
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ============================
   Very Small Viewport Responsive
   (Auto-applies for tiny iframes)
   ============================ */
@media (max-width: 320px) {
    body {
        font-size: 14px;
    }
    
    .container,
    .section-container {
        padding: 0.5rem;
    }
    
    .hero {
        padding: 1.5rem 0.5rem;
    }
    
    .hero h1 {
        font-size: 1.25rem;
    }
    
    .hero p {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .channel-header h2 {
        font-size: 0.9375rem;
    }
    
    .news-item a {
        font-size: 0.875rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   Today's Summary page — rank badge & channel source badge
   ========================================================================= */

/* Rank indicator: #1, #2, #3, #4 */
.summary-rank {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.375rem;
    margin-bottom: 0.375rem;
    vertical-align: middle;
}

/* Source channel badge (e.g. "BBC News", "Al Jazeera") */
.summary-channel-badge {
    display: inline-block;
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.25px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.375rem;
    margin-bottom: 0.375rem;
    vertical-align: middle;
}

/* Give summary list items a slightly more prominent left accent */
.summary-list .news-item {
    border-left: 3px solid #e5e7eb;
}

.summary-list .news-item:first-child {
    border-left-color: #2563eb;
}

.summary-list .news-item:nth-child(2) {
    border-left-color: #7c3aed;
}

.summary-list .news-item:nth-child(3) {
    border-left-color: #059669;
}

.summary-list .news-item:nth-child(4) {
    border-left-color: #d97706;
}

.summary-list .news-item:nth-child(n+5) {
    border-left-color: #9ca3af;
}

/* Alert banner shown before 8 PM generation cutoff */
.summary-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 0.875rem 1.125rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: #78350f;
    line-height: 1.5;
}

.summary-alert strong {
    color: #92400e;
}

.summary-alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}
