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

:root {
  --red: #CC0000;
  --red-dark: #990000;
  --white: #ffffff;
  --off-white: #f7f5f2;
  --black: #0a0a0a;
  --gray-100: #f0eeeb;
  --gray-200: #dddbd7;
  --gray-400: #999896;
  --gray-600: #555453;
  --gray-800: #2a2928;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --max-w: 1280px;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--off-white); color: var(--black); font-size: 16px; line-height: 1.6; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── HEADER ── */
.site-header { background: var(--white); border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.header-top { display: flex; align-items: center; justify-content: space-between; padding: 11px 24px; max-width: var(--max-w); margin: 0 auto; }
.header-date { font-size: 12px; color: var(--gray-400); letter-spacing: 0.04em; min-width: 150px; }
.header-brand { font-family: var(--font-display); font-size: clamp(18px, 3.5vw, 34px); font-weight: 900; letter-spacing: -0.02em; text-align: center; flex: 1; }
.brand-trending { color: var(--red); }
.brand-news { color: var(--black); }
.header-nav { display: flex; align-items: center; gap: 12px; min-width: 150px; justify-content: flex-end; }
.nav-icon-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gray-600); transition: all 0.2s; }
.nav-icon-btn:hover { background: var(--gray-100); color: var(--red); }
.btn-submit-story { background: var(--red); color: var(--white); font-size: 12px; font-weight: 500; padding: 7px 15px; border-radius: var(--radius); transition: background 0.2s; white-space: nowrap; }
.btn-submit-story:hover { background: var(--red-dark); }

/* ── SEARCH BAR ── */
.search-bar-wrap { max-height: 0; overflow: hidden; transition: max-height 0.3s; background: var(--white); border-top: 1px solid var(--gray-100); position: relative; }
.search-bar-wrap.open { max-height: 80px; overflow: visible; }
.search-bar-inner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; max-width: var(--max-w); margin: 0 auto; }
.search-icon-inline { color: var(--gray-400); flex-shrink: 0; }
.search-bar-inner input { flex: 1; border: none; font-family: var(--font-body); font-size: 15px; color: var(--black); background: transparent; outline: none; }
.search-clear { font-size: 14px; color: var(--gray-400); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.search-clear:hover { background: var(--gray-100); }
.search-results-drop { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 2px solid var(--gray-200); box-shadow: var(--shadow-lg); max-height: 380px; overflow-y: auto; z-index: 200; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 11px 24px; cursor: pointer; border-bottom: 1px solid var(--gray-100); transition: background 0.15s; }
.search-result-item:hover { background: var(--gray-100); }
.search-result-img { width: 50px; height: 38px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; background: var(--gray-200); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.search-result-tag { font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.search-result-title { font-size: 13px; font-weight: 500; color: var(--black); line-height: 1.3; }
.search-result-author { font-size: 11px; color: var(--gray-400); }
.search-no-result { padding: 18px 24px; font-size: 14px; color: var(--gray-400); text-align: center; }

/* ── TICKER ── */
.ticker-bar { background: var(--red); display: flex; align-items: center; overflow: hidden; height: 28px; }
.ticker-label { background: var(--black); color: var(--white); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; padding: 0 12px; height: 100%; display: flex; align-items: center; flex-shrink: 0; }
.ticker-track { overflow: hidden; flex: 1; }
.ticker-inner { display: flex; white-space: nowrap; animation: ticker 32s linear infinite; }
.ticker-inner span { color: var(--white); font-size: 12px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── TAG FILTER ── */
.tag-filter-bar { background: var(--white); border-bottom: 1px solid var(--gray-200); overflow-x: auto; scrollbar-width: none; }
.tag-filter-bar::-webkit-scrollbar { display: none; }
.tag-filter-inner { display: flex; gap: 5px; align-items: center; padding: 9px 24px; min-width: max-content; }
.tag-btn { font-size: 11px; font-weight: 500; padding: 5px 14px; border-radius: 20px; border: 1px solid var(--gray-200); color: var(--gray-600); background: var(--white); white-space: nowrap; transition: all 0.2s; letter-spacing: 0.02em; }
.tag-btn:hover { border-color: var(--red); color: var(--red); }
.tag-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }
.sitemap-btn { margin-left: auto; }

/* ── MAIN LAYOUT ── */
.main-grid { display: grid; grid-template-columns: 1fr 288px; gap: 28px; padding: 28px 24px; align-items: start; max-width: var(--max-w); margin: 0 auto; }
.main-content { display: flex; flex-direction: column; gap: 24px; }

/* ── HERO ── */
.hero-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; background: var(--gray-800); min-height: 420px; display: flex; align-items: flex-end; }
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.65; transition: transform 0.5s; }
.hero-card:hover img { transform: scale(1.03); }
.hero-overlay { position: relative; padding: 28px 32px; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 60%, transparent 100%); width: 100%; }
.hero-tag { display: inline-block; background: var(--red); color: var(--white); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius); margin-bottom: 10px; }
.hero-title { font-family: var(--font-display); font-size: clamp(20px, 3vw, 36px); font-weight: 700; color: var(--white); line-height: 1.15; margin-bottom: 10px; }
.hero-excerpt { font-size: 14px; color: rgba(255,255,255,0.75); margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { font-size: 12px; color: rgba(255,255,255,0.5); display: flex; gap: 16px; }
.hero-read-btn { display: inline-block; margin-top: 14px; padding: 8px 20px; background: var(--white); color: var(--black); border-radius: var(--radius); font-size: 13px; font-weight: 500; transition: all 0.2s; }
.hero-read-btn:hover { background: var(--red); color: var(--white); }
.hero-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 280px; background: var(--white); border-radius: var(--radius-lg); border: 2px dashed var(--gray-200); gap: 12px; }
.hero-empty p { color: var(--gray-400); font-size: 15px; }

/* ── POST CARDS ── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.posts-empty { grid-column: 1/-1; text-align: center; padding: 48px; color: var(--gray-400); }
.post-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.22s, box-shadow 0.22s; cursor: pointer; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card-img { height: 170px; overflow: hidden; background: var(--gray-100); }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.post-card:hover .post-card-img img { transform: scale(1.07); }
.post-card-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--gray-200); }
.post-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.post-card-tag { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.post-card-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; line-height: 1.3; margin-bottom: 7px; color: var(--black); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-excerpt { font-size: 12px; color: var(--gray-600); line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; }
.post-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 9px; border-top: 1px solid var(--gray-100); }
.post-card-meta { font-size: 11px; color: var(--gray-400); }
.post-card-read { font-size: 11px; color: var(--red); font-weight: 500; }

/* ── LOAD MORE ── */
.load-more-wrap { text-align: center; padding: 8px 0 4px; }
.btn-load-more { padding: 11px 32px; border: 2px solid var(--red); color: var(--red); border-radius: var(--radius); font-size: 13px; font-weight: 500; transition: all 0.2s; }
.btn-load-more:hover { background: var(--red); color: var(--white); }

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 115px; }
.sidebar-widget { background: var(--white); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.widget-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin-bottom: 12px; padding-bottom: 7px; border-bottom: 2px solid var(--red); color: var(--black); }
.sidebar-search-wrap { display: flex; align-items: center; gap: 7px; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 7px 10px; }
.sidebar-search-wrap svg { color: var(--gray-400); flex-shrink: 0; }
.sidebar-search-wrap input { flex: 1; border: none; font-family: var(--font-body); font-size: 13px; color: var(--black); outline: none; background: transparent; }
#sidebar-search-results { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-search-item { cursor: pointer; padding: 7px 8px; border-radius: var(--radius); transition: background 0.15s; }
.sidebar-search-item:hover { background: var(--gray-100); }
.sidebar-search-item .s-tag { font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.sidebar-search-item .s-title { font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--black); }
.most-read-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.most-read-list li { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.most-read-list li:hover .mr-title { color: var(--red); }
.mr-num { font-family: var(--font-display); font-size: 24px; font-weight: 900; color: var(--gray-200); line-height: 1; flex-shrink: 0; width: 26px; }
.mr-title { font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--gray-800); transition: color 0.2s; }
.ad-zone { text-align: center; }
.ad-label { font-size: 10px; color: var(--gray-400); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 7px; }
.ad-placeholder { background: var(--gray-100); border: 1px dashed var(--gray-200); border-radius: var(--radius); height: 250px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--gray-400); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill { font-size: 11px; padding: 4px 11px; border-radius: 20px; background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); cursor: pointer; transition: all 0.2s; }
.tag-pill:hover { background: var(--red); color: var(--white); border-color: var(--red); }

/* ── FOOTER ── */
.site-footer { background: var(--black); color: var(--white); padding: 40px 24px 0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; max-width: var(--max-w); margin: 0 auto; padding-bottom: 28px; }
.footer-brand { font-family: var(--font-display); font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.footer-brand span { color: var(--red); }
.footer-tagline { font-size: 13px; color: var(--gray-400); line-height: 1.5; margin-top: 6px; }
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-links h4 { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 4px; }
.footer-links a { font-size: 13px; color: var(--gray-200); transition: color 0.2s; }
.footer-links a:hover { color: var(--red); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #1e1e1e; padding: 14px 0; font-size: 12px; color: var(--gray-600); max-width: var(--max-w); margin: 0 auto; }

/* ── MODALS ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.62); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform 0.28s; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; background: var(--white); z-index: 1; }
.modal-header h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-close { font-size: 16px; color: var(--gray-400); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.modal-close:hover { background: var(--gray-100); color: var(--black); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 13px; }

/* ── FORMS ── */
.form-input { width: 100%; padding: 9px 13px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; color: var(--black); background: var(--white); transition: border-color 0.2s; }
.form-input:focus { outline: none; border-color: var(--red); }
.form-headline { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--gray-600); letter-spacing: 0.03em; }
.form-select { width: 100%; padding: 9px 13px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; color: var(--black); background: var(--white); }
.form-select:focus { outline: none; border-color: var(--red); }
.form-textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; line-height: 1.7; color: var(--black); resize: vertical; }
.form-textarea:focus { outline: none; border-color: var(--red); }
.image-upload-zone { border: 2px dashed var(--gray-200); border-radius: var(--radius-lg); padding: 18px; text-align: center; cursor: pointer; transition: all 0.2s; }
.image-upload-zone:hover { border-color: var(--red); background: #fff8f8; }
.upload-icon { font-size: 26px; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.btn-cancel { padding: 9px 20px; border-radius: var(--radius); border: 1px solid var(--gray-200); font-size: 13px; color: var(--gray-600); transition: all 0.2s; }
.btn-cancel:hover { background: var(--gray-100); }
.btn-primary { padding: 9px 24px; border-radius: var(--radius); background: var(--red); color: var(--white); font-size: 13px; font-weight: 500; transition: background 0.2s; border: none; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { background: var(--gray-400); cursor: not-allowed; }

/* ── STATIC PAGE LAYOUT ── */
.static-page { max-width: 780px; margin: 48px auto; padding: 0 24px 80px; }
.static-page h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 44px); font-weight: 900; margin-bottom: 8px; }
.static-page .page-meta { font-size: 13px; color: var(--gray-400); margin-bottom: 36px; padding-bottom: 20px; border-bottom: 2px solid var(--red); }
.static-page h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 32px 0 12px; color: var(--black); }
.static-page p { font-size: 15px; color: var(--gray-800); line-height: 1.8; margin-bottom: 14px; }
.static-page ul { padding-left: 22px; margin-bottom: 14px; }
.static-page ul li { font-size: 15px; color: var(--gray-800); line-height: 1.8; margin-bottom: 6px; }
.static-page a { color: var(--red); }

/* ── CONTACT FORM ── */
.contact-form { background: var(--white); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.contact-form input, .contact-form textarea, .contact-form select { padding: 11px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; color: var(--black); width: 100%; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--red); }
.contact-info-box { background: var(--red); color: var(--white); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.contact-info-box h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 12px; }
.contact-info-box p { font-size: 14px; opacity: 0.9; margin-bottom: 8px; }
.contact-info-box a { color: var(--white); text-decoration: underline; }

/* ── SUCCESS / ERROR TOAST ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--black); color: var(--white); padding: 12px 22px; border-radius: var(--radius-lg); font-size: 14px; font-weight: 500; z-index: 500; opacity: 0; transform: translateY(8px); transition: all 0.3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #1a6b3c; }
.toast.error { background: var(--red-dark); }

/* ── SITEMAP ── */
.sitemap-intro { font-size: 14px; color: var(--gray-600); margin-bottom: 18px; }
.sitemap-section { margin-bottom: 22px; }
.sitemap-section h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--red); margin-bottom: 9px; border-bottom: 1px solid var(--gray-200); padding-bottom: 5px; }
.sitemap-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.sitemap-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 13px; }
.sitemap-list li a { color: var(--black); font-weight: 500; flex: 1; transition: color 0.2s; }
.sitemap-list li a:hover { color: var(--red); }
.sitemap-list li span { color: var(--gray-400); white-space: nowrap; font-size: 11px; }
.sitemap-xml { background: var(--gray-100); border-radius: var(--radius); padding: 14px; font-family: monospace; font-size: 11px; color: var(--gray-600); overflow: auto; max-height: 180px; white-space: pre; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .main-grid { grid-template-columns: 1fr; padding: 20px 16px; }
  .sidebar { position: static; }
}
@media (max-width: 640px) {
  .header-top { flex-wrap: wrap; gap: 6px; }
  .header-date { display: none; }
  .header-nav { width: 100%; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
}

/* ── LAZY LOAD IMAGES ── */
img[data-src] { opacity: 0; transition: opacity 0.4s ease; background: var(--gray-100); }
img.loaded { opacity: 1; }

/* ── SKELETON LOADING CARDS ── */
/* Shows animated placeholder cards while posts load from Supabase */
.skeleton-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.skel { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-img { height: 170px; border-radius: 0; }
.skel-tag { height: 12px; width: 60px; margin: 14px 16px 8px; }
.skel-title { height: 16px; width: 90%; margin: 0 16px 6px; }
.skel-title-2 { height: 16px; width: 70%; margin: 0 16px 10px; }
.skel-text { height: 12px; width: 85%; margin: 0 16px 4px; }
.skel-text-2 { height: 12px; width: 65%; margin: 0 16px 14px; }
.skel-meta { height: 11px; width: 50%; margin: 0 16px 14px; }
.skel-hero { height: 420px; border-radius: var(--radius-lg); }
