/* ===== AiFlick — Ad-Optimized News Site ===== */
:root {
  --accent: #1a56db;
  --accent-dark: #143ea8;
  --accent-light: #3b82f6;
}

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

body { font-family: 'Inter', system-ui, sans-serif; color: #1f2937; background: #f9fafb; }

a { text-decoration: none; color: inherit; }

/* ---- Ad Zone Base ---- */
.ad-zone { display: flex; justify-content: center; padding: 12px 16px; }
.ad-container { display: flex; flex-direction: column; align-items: center; }
.ad-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; margin-bottom: 4px; }

/* ---- Ins Zone Sizing (critical for ad display) ---- */
.ins-zone { display: block !important; margin: 0 auto; }

/* Size by data-ad-size on parent container */
.ad-container[data-ad-size="728×90"] .ins-zone,
.ad-container[data-ad-size="728×90 / 970×250"] .ins-zone { width: 728px; max-width: 100%; min-height: 90px; }
.ad-container[data-ad-size="970×250"] .ins-zone { width: 970px; max-width: 100%; min-height: 250px; }
.ad-container[data-ad-size="300×250"] .ins-zone { width: 300px; max-width: 100%; min-height: 250px; }
.ad-container[data-ad-size="336×280"] .ins-zone { width: 336px; max-width: 100%; min-height: 280px; }
.ad-container[data-ad-size="300×600"] .ins-zone { width: 300px; max-width: 100%; min-height: 600px; }
.ad-container[data-ad-size="160×600"] .ins-zone { width: 160px; min-height: 600px; }
.ad-container[data-ad-size="320×100"] .ins-zone { width: 320px; max-width: 100%; min-height: 100px; }

/* Fallback: size by zone ID */
.ins-zone[data-zone="164090"] { width: 728px; max-width: 100%; min-height: 90px; }
.ins-zone[data-zone="164134"] { width: 970px; max-width: 100%; min-height: 250px; }
.ins-zone[data-zone="164087"] { width: 300px; max-width: 100%; min-height: 250px; }
.ins-zone[data-zone="164133"] { width: 336px; max-width: 100%; min-height: 280px; }
.ins-zone[data-zone="164132"] { width: 300px; max-width: 100%; min-height: 600px; }
.ins-zone[data-zone="164089"] { width: 160px; min-height: 600px; }
.ins-zone[data-zone="164091"] { width: 320px; max-width: 100%; min-height: 100px; }

.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #e8e8e8, #e8e8e8 10px, #f0f0f0 10px, #f0f0f0 20px);
  border: 2px dashed #bbb; color: #666; font-size: 15px; font-weight: 700;
  text-align: center; border-radius: 4px; transition: border-color 0.2s, background 0.2s;
}
.ad-placeholder:hover { border-color: var(--accent); background: repeating-linear-gradient(45deg, #e0e7ff, #e0e7ff 10px, #eef2ff 10px, #eef2ff 20px); }
.ad-hint { font-size: 11px; font-weight: 400; color: #888; margin-top: 4px; }

/* ---- Ad Sizes ---- */
.ad-leaderboard { width: 728px; max-width: 100%; height: 90px; }
.ad-billboard { width: 970px; max-width: 100%; height: 250px; }
.ad-medium-rect { width: 300px; max-width: 100%; height: 250px; }
.ad-large-rect { width: 336px; max-width: 100%; height: 280px; }
.ad-half-page { width: 300px; max-width: 100%; height: 600px; }
.ad-skyscraper-160 { width: 160px; height: 600px; }
.ad-mobile-banner { width: 320px; max-width: 100%; height: 100px; }

/* ---- Ad Zones ---- */
.ad-top-leaderboard { background: #fff; border-bottom: 1px solid #e5e7eb; }
.ad-billboard-zone { background: #fff; padding: 16px; }
.ad-in-content { margin: 28px 0; }
.ad-in-content-center { margin: 28px 0; display: flex; justify-content: center; }
.ad-in-text-float { float: right; margin: 0 0 16px 24px; max-width: 336px; }
.ad-in-text-float .ad-placeholder { width: 336px; max-width: 100%; height: 280px; }

/* ---- Sticky Mobile Ad ---- */
.ad-sticky-mobile {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: #fff; border-top: 1px solid #e5e7eb; padding: 6px 0;
  justify-content: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

/* ---- Navigation ---- */
.nav { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-logo { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 900; color: var(--accent); }
.nav-menu { display: flex; align-items: center; gap: 24px; list-style: none; }
.nav-link { font-size: 14px; font-weight: 500; color: #374151; padding: 4px 0; border-bottom: 2px solid transparent; transition: all 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-mobile-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-mobile-btn svg { width: 24px; height: 24px; }

/* ---- Layout ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.main-layout { display: flex; gap: 24px; padding: 24px 0; }
.main-content { flex: 1; min-width: 0; }
.sidebar-left { display: none; width: 160px; flex-shrink: 0; }
.sidebar-right { display: none; width: 300px; flex-shrink: 0; }
.sticky-wrap { position: sticky; top: 72px; }

@media (min-width: 768px) { .sidebar-right { display: block; } }
@media (min-width: 1024px) { .sidebar-left { display: block; } }

/* ---- Article Cards ---- */
.article-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; display: block; }
.article-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.article-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.article-card-body { padding: 16px; }
.article-card h3, .article-card h4 { font-family: 'Playfair Display', serif; font-weight: 700; line-height: 1.3; color: #111; }
.article-card h3 { font-size: 18px; margin: 8px 0; }
.article-card h4 { font-size: 16px; margin: 8px 0; }
.article-card .excerpt { font-size: 13px; color: #6b7280; line-height: 1.5; margin-top: 6px; }
.article-card .meta { font-size: 12px; color: #9ca3af; margin-top: 8px; }

/* ---- Category Badges ---- */
.cat-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 3px 10px; border-radius: 4px; color: #fff; }
.cat-tech { background: #1a56db; }
.cat-finance { background: #059669; }
.cat-health { background: #e11d48; }
.cat-travel { background: #d97706; }
.cat-living { background: #4f46e5; }

/* ---- Section Headers ---- */
.section-header { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: #111; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #e5e7eb; position: relative; }
.section-header::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 60px; height: 2px; background: var(--accent); }

/* ---- Hero Section ---- */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 2fr 1fr; } }
.hero-main { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); cursor: pointer; display: block; }
.hero-main img { width: 100%; height: 340px; object-fit: cover; display: block; }
@media (min-width: 768px) { .hero-main img { height: 420px; } }
.hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px; background: linear-gradient(transparent, rgba(0,0,0,0.85)); }
.hero-overlay h2 { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 900; color: #fff; line-height: 1.3; }
@media (min-width: 768px) { .hero-overlay h2 { font-size: 30px; } }
.hero-overlay .cat-badge { margin-bottom: 8px; }
.hero-overlay .meta { font-size: 12px; color: #d1d5db; margin-top: 8px; }
.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-side-card { display: flex; gap: 12px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.2s; }
.hero-side-card:hover { transform: translateY(-2px); }
.hero-side-card img { width: 120px; height: 90px; object-fit: cover; flex-shrink: 0; }
.hero-side-card-body { padding: 10px 12px; }
.hero-side-card-body h4 { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700; line-height: 1.3; color: #111; }
.hero-side-card-body .meta { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ---- Article Grid ---- */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .article-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .article-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* ---- Sidebar Widgets ---- */
.sidebar-widget { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 16px; }
.widget-title { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e5e7eb; }
.trending-list { list-style: none; padding: 0; margin: 0; }
.trending-list li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.trending-list li:last-child { border-bottom: none; }
.trend-num { flex-shrink: 0; width: 24px; height: 24px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.trending-list a { font-size: 13px; color: #374151; line-height: 1.4; transition: color 0.2s; }
.trending-list a:hover { color: var(--accent); }
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.cat-list li:last-child { border-bottom: none; }
.cat-list a { display: flex; justify-content: space-between; font-size: 14px; color: #374151; transition: color 0.2s; }
.cat-list a:hover { color: var(--accent); }
.cat-list span { color: #9ca3af; font-size: 12px; }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 32px 0; }
.page-btn { padding: 8px 14px; border: 1px solid #e5e7eb; background: #fff; border-radius: 6px; font-size: 14px; font-weight: 500; color: #374151; cursor: pointer; transition: all 0.2s; }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn.next { border: none; color: var(--accent); font-weight: 600; }

/* ---- Footer ---- */
.footer { background: #111827; color: #d1d5db; padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-logo { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 900; color: #fff; margin-bottom: 8px; }
.footer-desc { font-size: 14px; color: #9ca3af; line-height: 1.6; margin-bottom: 16px; }
.footer-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 13px; color: #9ca3af; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-social { display: flex; gap: 12px; margin-top: 12px; }
.social-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #374151; border-radius: 50%; color: #fff; transition: background 0.2s; }
.social-icon:hover { background: var(--accent); }
.social-icon svg { width: 18px; height: 18px; }
.newsletter-form { display: flex; flex-direction: column; gap: 8px; }
.newsletter-input { padding: 8px 12px; border: 1px solid #4b5563; background: #1f2937; border-radius: 6px; color: #fff; font-size: 13px; outline: none; }
.newsletter-input::placeholder { color: #6b7280; }
.newsletter-input:focus { border-color: var(--accent); }
.newsletter-btn { padding: 8px 16px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.newsletter-btn:hover { background: var(--accent-dark); }
.footer-bottom { border-top: 1px solid #374151; margin-top: 24px; padding-top: 16px; text-align: center; font-size: 12px; color: #6b7280; }

/* ---- Article Page ---- */
.breadcrumb { font-size: 13px; color: #6b7280; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 16px 0; }
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .current { color: #374151; font-weight: 500; }
.breadcrumb .sep { color: #d1d5db; }

.article-header { margin-bottom: 24px; }
.article-title { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; line-height: 1.2; color: #111; margin: 12px 0 16px; }
@media (min-width: 768px) { .article-title { font-size: 36px; } }
.article-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.author-info { display: flex; align-items: center; gap: 10px; }
.author-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.author-name { font-size: 14px; font-weight: 600; color: #111; display: block; }
.article-date { font-size: 12px; color: #9ca3af; }
.share-buttons { display: flex; gap: 6px; }
.share-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.share-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.share-btn svg { width: 16px; height: 16px; }

.article-featured-img { width: 100%; height: 400px; object-fit: cover; border-radius: 8px; margin-bottom: 24px; display: block; }
@media (max-width: 768px) { .article-featured-img { height: 220px; } }

.article-body { font-size: 16px; line-height: 1.8; color: #374151; max-width: 720px; margin: 0 auto; }
.article-lead { font-size: 18px; line-height: 1.7; color: #111; font-weight: 500; margin-bottom: 24px; padding-left: 16px; border-left: 4px solid var(--accent); }
.article-h2 { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: #111; margin: 32px 0 12px; }
.article-body p { margin-bottom: 16px; }
.article-body ul { margin: 16px 0 24px; padding-left: 20px; }
.article-body ul li { margin-bottom: 10px; line-height: 1.7; }
.article-body strong { color: #111; }
.article-conclusion { font-size: 17px; font-weight: 500; color: #111; padding: 16px; background: #eff6ff; border-radius: 8px; border-left: 4px solid var(--accent); margin-top: 24px; }

/* ---- Budget Table ---- */
.budget-table-wrapper { overflow-x: auto; margin: 24px 0; border-radius: 8px; border: 1px solid #e5e7eb; }
.budget-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.budget-table th { background: var(--accent); color: #fff; padding: 12px 16px; text-align: left; font-weight: 600; }
.budget-table td { padding: 12px 16px; border-bottom: 1px solid #e5e7eb; }
.budget-table tr:nth-child(even) { background: #f9fafb; }
.budget-table .total-row { background: #eff6ff; font-weight: 700; }
.budget-table .total-row td { border-top: 2px solid var(--accent); border-bottom: none; }

/* ---- Article Tags ---- */
.article-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 24px 0; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.article-tags > span { font-size: 13px; font-weight: 600; color: #6b7280; }
.tag { font-size: 12px; padding: 4px 12px; background: #f3f4f6; color: #374151; border-radius: 20px; transition: all 0.2s; }
.tag:hover { background: var(--accent); color: #fff; }

/* ---- Author Box ---- */
.author-box { display: flex; gap: 16px; padding: 24px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin: 24px 0; }
.author-box-avatar { flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.author-box-content h3 { font-size: 18px; font-weight: 700; color: #111; margin-bottom: 4px; }
.author-box-content p { font-size: 14px; color: #6b7280; line-height: 1.6; margin-bottom: 8px; }
.author-box-social { display: flex; gap: 16px; }
.author-box-social a { font-size: 13px; color: var(--accent); font-weight: 500; }
.author-box-social a:hover { text-decoration: underline; }

/* ---- Related Articles ---- */
.related-section { margin: 32px 0; }

/* ---- Comments ---- */
.comments-section { margin: 32px 0; }
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid #f3f4f6; }
.comment-avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: #e5e7eb; color: #6b7280; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.comment-body { flex: 1; }
.comment-author { font-size: 14px; font-weight: 600; color: #111; margin-right: 8px; }
.comment-date { font-size: 12px; color: #9ca3af; }
.comment-body p { font-size: 14px; color: #4b5563; line-height: 1.6; margin-top: 4px; }
.comment-form { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.comment-form h4 { font-size: 16px; font-weight: 700; color: #111; }
.comment-input { padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px; outline: none; transition: border-color 0.2s; font-family: inherit; }
.comment-input:focus { border-color: var(--accent); }
.comment-textarea { padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px; outline: none; resize: vertical; font-family: inherit; transition: border-color 0.2s; }
.comment-textarea:focus { border-color: var(--accent); }
.comment-btn { align-self: flex-start; padding: 10px 24px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.comment-btn:hover { background: var(--accent-dark); }

/* ---- Category Page ---- */
.category-hero { background: #fff; padding: 32px 16px; text-align: center; border-bottom: 1px solid #e5e7eb; }
.category-hero h1 { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 900; color: #111; }
.category-hero p { font-size: 15px; color: #6b7280; margin-top: 8px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ---- Static Pages (About/Contact/Privacy) ---- */
.static-page { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.static-page h1 { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 900; color: #111; margin-bottom: 16px; }
.static-page h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: #111; margin: 28px 0 12px; }
.static-page p { font-size: 16px; line-height: 1.8; color: #374151; margin-bottom: 16px; }
.static-page ul { margin: 16px 0; padding-left: 20px; }
.static-page ul li { margin-bottom: 10px; line-height: 1.7; color: #374151; }
.contact-form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.contact-form input, .contact-form textarea { padding: 12px 16px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 15px; outline: none; font-family: inherit; transition: border-color 0.2s; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form button { align-self: flex-start; padding: 12px 28px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.contact-form button:hover { background: var(--accent-dark); }

/* ---- Mobile Menu ---- */
.nav-menu.mobile-open { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: #fff; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); gap: 12px; }
.nav-menu.mobile-open li { text-align: center; }

@media (max-width: 768px) {
  .nav-menu { display: none; }
  .nav-mobile-btn { display: block; }
  .ad-leaderboard, .ad-billboard { width: 100%; max-width: 100%; }
  .ad-billboard { height: 200px; }
  .ad-sticky-mobile { display: flex; }
  body { padding-bottom: 120px; }
  .article-title { font-size: 22px; }
  .article-h2 { font-size: 18px; }
  .ad-in-text-float { float: none; margin: 20px 0; max-width: 100%; display: flex; justify-content: center; }
  .article-meta { flex-direction: column; align-items: flex-start; }
  .author-box { flex-direction: column; }
  .main-layout { flex-direction: column; }
  .sidebar-right { width: 100%; }
}

@media (max-width: 480px) {
  .ad-leaderboard { height: 100px; }
  .ad-billboard { height: 150px; }
  .ad-large-rect, .ad-medium-rect { width: 100%; max-width: 336px; }
}
