/* =============================================
   GREEN LOCAL NEWS - HOME PAGE STYLES
   ============================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.6;
}

.container,
.content-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-icon { font-size: 3rem; margin-bottom: 1rem; }
.modal-box h2 { font-size: 1.5rem; margin-bottom: 0.75rem; color: #1a1a2e; }
.modal-box p { color: #666; margin-bottom: 1.5rem; }

.modal-divider {
    color: #999;
    margin: 1rem 0;
    position: relative;
}

.modal-divider::before, .modal-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: #ddd;
}
.modal-divider::before { left: 0; }
.modal-divider::after { right: 0; }

.location-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.location-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.location-search input:focus { border-color: #2e7d32; }

.location-error {
    color: #c62828;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #ffebee;
    border-radius: 6px;
}

/* ---- BUTTONS ---- */
.btn-primary {
    display: inline-block;
    background: #2e7d32;
    color: #fff;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}

.btn-primary:hover { background: #1b5e20; transform: translateY(-1px); }

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-secondary:hover { background: #e0e0e0; }

.btn-skip {
    background: none;
    border: none;
    color: #999;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.75rem;
    text-decoration: underline;
}

.btn-skip:hover { color: #666; }

.btn-refresh {
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover { border-color: #2e7d32; background: #f1f8e9; }
.btn-refresh.spinning { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.btn-load-more {
    background: #fff;
    border: 2px solid #2e7d32;
    color: #2e7d32;
    padding: 0.85rem 2.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover { background: #2e7d32; color: #fff; }

.btn-change-location {
    background: none;
    border: 1px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* ---- HEADER ---- */
.site-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.brand-icon { font-size: 2rem; }

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.75rem;
    opacity: 0.8;
}

.header-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-left: auto;
}

.main-nav {
    display: flex;
    gap: 1.25rem;
}

.main-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover { color: #fff; }

/* ---- BREAKING BANNER ---- */
.breaking-banner {
    background: #c62828;
    color: #fff;
    padding: 0.6rem 0;
    overflow: hidden;
}

.breaking-banner .container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breaking-label {
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.breaking-ticker {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- MAIN LAYOUT ---- */
.site-main { padding: 2rem 0; }

.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

/* ---- SECTION HEADER ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h1 {
    font-size: 1.5rem;
    color: #1a1a2e;
    font-weight: 700;
}

.feed-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ---- CATEGORY TABS ---- */
.category-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    color: #555;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { border-color: #2e7d32; color: #2e7d32; }
.tab-btn.active { background: #2e7d32; border-color: #2e7d32; color: #fff; }

/* ---- STORIES GRID ---- */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ---- STORY CARD ---- */
.story-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.story-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.story-card.featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.story-card.featured .card-image { height: 100%; min-height: 220px; }

.card-image {
    height: 180px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.breaking-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: #c62828;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.card-body { padding: 1.25rem; }

.card-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2e7d32;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-card.featured .card-title { font-size: 1.2rem; }

.card-excerpt {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #999;
}

.card-views { display: flex; align-items: center; gap: 0.25rem; }

/* ---- SKELETON LOADERS ---- */
.skeleton-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
}

.skeleton-img {
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin: 0.75rem 1rem;
}

.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w75 { width: 75%; }
.skeleton-line.w85 { width: 85%; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 12px;
}

.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.empty-state p { color: #666; }
.empty-state a { color: #2e7d32; }

/* ---- FEED META ---- */
.feed-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #aaa;
    margin-top: 1rem;
    padding: 0 0.25rem;
}

/* ---- SIDEBAR ---- */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8f5e9;
}

/* ---- AD PLACEHOLDER ---- */
.ad-widget { padding: 0; overflow: hidden; }

.ad-placeholder {
    height: 250px;
    background: linear-gradient(135deg, #f5f5f5, #eeeeee);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.ad-placeholder span { color: #bbb; font-size: 0.85rem; }

/* ---- TRENDING ---- */
.trending-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.trending-list li.skeleton-line { margin: 0; }

.trending-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.trending-item:hover { background: #f5f7fa; }

.trending-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2e7d32;
    min-width: 24px;
    line-height: 1.3;
}

.trending-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    color: #333;
}

/* ---- WEATHER ---- */
.weather-widget { text-align: center; }
.weather-loading { color: #999; font-size: 0.85rem; }

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.weather-temp { font-size: 2.5rem; font-weight: 700; color: #1a1a2e; }
.weather-icon { font-size: 2.5rem; }
.weather-desc { color: #666; font-size: 0.9rem; }
.weather-location { font-size: 0.8rem; color: #999; margin-top: 0.25rem; }

/* ---- CTA WIDGET ---- */
.cta-widget { text-align: center; background: linear-gradient(135deg, #e8f5e9, #f1f8e9); }
.cta-widget h3 { margin-bottom: 0.5rem; }
.cta-widget p { color: #555; font-size: 0.9rem; margin-bottom: 1rem; }
.cta-widget .btn-primary { width: auto; }

/* ---- FOOTER ---- */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand .brand-icon { font-size: 2rem; }
.footer-brand strong { display: block; color: #fff; font-size: 1.1rem; margin: 0.5rem 0; }
.footer-brand p { font-size: 0.85rem; color: #888; }

.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links h4 { color: #fff; font-size: 0.9rem; margin-bottom: 0.25rem; }
.footer-links a { color: #888; text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: #a5d6a7; }

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); }
    .stories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
    .stories-grid { grid-template-columns: 1fr; }
    .story-card.featured { grid-column: span 1; grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; }
    .main-nav { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .sidebar { grid-template-columns: 1fr; }
    .category-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.25rem; }
}
/* ---- FEATURED STORY (top hero card) ---- */
.featured-story { margin-bottom: 1.75rem; }

.featured-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.featured-inner:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.featured-img { position: relative; min-height: 280px; }

.featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-no-img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.featured-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content .story-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2e7d32;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.featured-content h2 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    color: #1a1a2e;
}

.featured-content p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.featured-content .story-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #999;
}

@media (max-width: 700px) {
    .featured-inner { grid-template-columns: 1fr; }
    .featured-img, .featured-no-img { min-height: 200px; }
}

/* ---- HEADER ACTION BUTTONS (Login / Submit a Story / etc.) ---- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-nav {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #2e7d32;
    color: #2e7d32;
    background: #fff;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-nav:hover {
    background: #2e7d32;
    color: #fff;
}

.btn-nav.btn-submit {
    background: #2e7d32;
    color: #fff;
}

.btn-nav.btn-submit:hover {
    background: #1b5e20;
    border-color: #1b5e20;
}

.btn-nav.btn-outline {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-nav.btn-outline:hover {
    background: #fff;
    color: #2e7d32;
}

.btn-nav.btn-green {
    background: #4ade80;
    border-color: #4ade80;
    color: #14171a;
}

@media (max-width: 680px) {
    .btn-nav { padding: 0.45rem 0.8rem; font-size: 0.78rem; }
}

/* ---- COOKIE CONSENT BANNER ---- */
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #1a1a2e;
    color: #f1f1f1;
    z-index: 2000;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.25);
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-banner-inner p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    min-width: 240px;
}

.cookie-banner-inner a { color: #4ade80; }

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .cookie-banner-inner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-banner-actions { justify-content: center; }
}
