/* ============================================================
   AutoBlog — Professional News Site Stylesheet
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #1a73e8;
  --blue-dk: #1558b0;
  --red:     #d32f2f;
  --dark:    #1a1a2e;
  --gray:    #555;
  --lgray:   #f5f6fa;
  --border:  #e0e4ed;
  --white:   #ffffff;
  --radius:  8px;
  --shadow:  0 2px 12px rgba(0,0,0,.10);
  --font:    'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  background: #f0f2f7;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dk); text-decoration: underline; }
img { max-width: 100%; display: block; object-fit: cover; }
h1,h2,h3,h4,h5 { line-height: 1.3; color: var(--dark); }
ul { list-style: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ── Masthead / Logo Banner ───────────────────────────────── */
.masthead {
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2744 50%, #0d1b2a 100%);
  border-bottom: 3px solid var(--red);
  padding: 18px 0 14px;
  text-align: center;
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.masthead-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.masthead-name {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: 'Georgia', 'Times New Roman', serif;
  letter-spacing: -1px;
  line-height: 1;
  background: linear-gradient(90deg, #ffffff 0%, #b3c7e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.masthead-tagline {
  font-size: .72rem;
  color: #8da4c8;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.masthead-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.masthead-date {
  font-size: .78rem;
  color: #8da4c8;
  letter-spacing: .5px;
}

.masthead-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
}

.masthead-badge::before {
  content: '●';
  animation: blink 1.2s step-start infinite;
  font-size: .6rem;
}

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

@media (max-width: 600px) {
  .masthead-inner { justify-content: center; }
  .masthead-name  { font-size: 1.6rem; }
  .masthead-meta  { align-items: center; }
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.hdr-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.site-logo:hover { color: #90caf9; text-decoration: none; }

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.main-nav a {
  color: #cdd7e8;
  font-size: .88rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.main-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }

.hdr-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.lang-btn, .nav-toggle {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s;
  white-space: nowrap;
}
.lang-btn:hover, .nav-toggle:hover { background: rgba(255,255,255,.22); }
.nav-toggle { display: none; }

.search-bar {
  padding-bottom: 10px;
  padding-top: 2px;
}
.search-form {
  display: flex;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 22px;
  overflow: hidden;
  max-width: 540px;
}
.search-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 7px 16px;
  font-size: .88rem;
  outline: none;
}
.search-form input::placeholder { color: rgba(255,255,255,.5); }
.search-form button {
  background: var(--blue);
  border: none;
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-size: 1rem;
  transition: background .2s;
}
.search-form button:hover { background: var(--blue-dk); }

/* ── Ticker ───────────────────────────────────────────────── */
.ticker-bar {
  background: var(--red);
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 36px;
  margin-bottom: 0;
}
.ticker-label {
  background: #b71c1c;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 0 14px;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  letter-spacing: .5px;
}
.ticker-track { flex: 1; overflow: hidden; position: relative; height: 100%; }
.ticker-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
  height: 100%;
}
.ticker-item {
  color: #fff;
  font-size: .83rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.ticker-item::before { content: '◆'; margin-right: 8px; opacity: .7; }
.ticker-item:hover { text-decoration: underline; }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* ── Featured Post ────────────────────────────────────────── */
.featured-wrap { margin: 24px 0; }

.featured-card { display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }

.featured-img {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 440px;
  display: flex;
  align-items: flex-end;
}

.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.85) 100%);
}

.featured-body {
  position: relative;
  z-index: 1;
  padding: 30px;
  color: #fff;
  width: 100%;
  max-width: 780px;
}

.featured-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  margin: 10px 0 12px;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.featured-excerpt {
  font-size: 1rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 14px;
  max-width: 600px;
}

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: .9rem;
}
.clear-btn {
  background: var(--red);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8rem;
  text-decoration: none;
}

/* ── Page Layout (grid + sidebar) ────────────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  margin: 24px 0 40px;
}

/* ── Posts Grid ───────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.post-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.13); }

.card-img-link { position: relative; display: block; }
.card-img { width: 100%; height: 190px; object-fit: cover; }
.card-img-link .cat-badge { position: absolute; top: 10px; left: 10px; }

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}
.card-title a { color: var(--dark); text-decoration: none; }
.card-title a:hover { color: var(--blue); }

.card-excerpt {
  font-size: .86rem;
  color: var(--gray);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
}

.read-btn {
  background: var(--blue);
  color: #fff;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.read-btn:hover { background: var(--blue-dk); text-decoration: none; color: #fff; }

.ad-in-grid { grid-column: 1 / -1; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.pg-btn {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--dark);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: .88rem;
  transition: all .2s;
  text-decoration: none;
}
.pg-btn:hover, .pg-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  text-decoration: none;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.widget {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--dark);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.side-list { display: flex; flex-direction: column; gap: 14px; }
.side-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--dark);
  transition: color .2s;
}
.side-item:hover { color: var(--blue); text-decoration: none; }
.side-item img { width: 70px; height: 52px; border-radius: 5px; flex-shrink: 0; object-fit: cover; }
.side-item span { font-size: .83rem; line-height: 1.4; }
.side-item small { display: block; color: var(--gray); font-size: .75rem; margin-top: 3px; }

.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: .87rem;
  color: var(--dark);
  transition: background .2s, color .2s;
  text-decoration: none;
}
.cat-list a:hover { background: var(--lgray); color: var(--blue); text-decoration: none; }
.cnt {
  background: var(--lgray);
  color: var(--gray);
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.about-widget p { font-size: .88rem; color: var(--gray); margin-bottom: 12px; }
.outline-btn {
  display: inline-block;
  border: 1px solid var(--blue);
  color: var(--blue);
  padding: 6px 14px;
  border-radius: 18px;
  font-size: .83rem;
  font-weight: 600;
  transition: all .2s;
  text-decoration: none;
}
.outline-btn:hover { background: var(--blue); color: #fff; text-decoration: none; }

/* ── Badges & Meta ─────────────────────────────────────────── */
.cat-badge {
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}
.cat-badge.sm { font-size: .68rem; padding: 2px 8px; }

.post-date { color: var(--gray); font-size: .82rem; }

/* ── Article Page ─────────────────────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  margin-top: 20px;
  margin-bottom: 40px;
}

.breadcrumb {
  font-size: .82rem;
  color: var(--gray);
  padding: 12px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--blue); text-decoration: none; }

.article {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.article-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--dark);
  margin-bottom: 14px;
}

.article-excerpt {
  font-size: 1.1rem;
  color: var(--gray);
  border-left: 4px solid var(--blue);
  padding-left: 16px;
  margin-bottom: 24px;
  line-height: 1.6;
}

.article-hero {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.article-hero img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

/* Share */
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.share-row span { font-size: .85rem; color: var(--gray); font-weight: 600; }
.share-btn {
  padding: 6px 14px;
  border-radius: 18px;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: opacity .2s;
}
.share-btn:hover { opacity: .85; color: #fff; text-decoration: none; }
.share-btn.tw { background: #000; }
.share-btn.fb { background: #1877f2; }
.share-btn.wa { background: #25d366; }
.share-btn.li { background: #0a66c2; }

/* Article content typography */
.article-content { font-size: 1.03rem; line-height: 1.8; color: #2c2c2c; }
.article-content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--dark);
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.article-content h3 { font-size: 1.2rem; font-weight: 700; margin: 24px 0 10px; }
.article-content p { margin-bottom: 18px; }
.article-content strong { color: var(--dark); }
.article-content ul, .article-content ol { margin: 0 0 18px 22px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote {
  border-left: 4px solid var(--blue);
  background: var(--lgray);
  padding: 14px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-style: italic;
  color: var(--gray);
}

/* Tags */
.tags-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.tag {
  background: var(--lgray);
  color: var(--gray);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: .8rem;
  text-decoration: none;
  transition: all .2s;
}
.tag:hover { background: var(--blue); color: #fff; border-color: var(--blue); text-decoration: none; }

/* Author */
.author-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--lgray);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
}
.author-icon { font-size: 2rem; }
.author-box strong { font-size: .95rem; }
.author-box small { color: var(--gray); font-size: .82rem; }

.source-link { font-size: .85rem; color: var(--gray); margin-top: 12px; }
.source-link a { color: var(--blue); }

/* ── Related Posts ─────────────────────────────────────────── */
.related-section {
  margin: 0 auto 40px;
  padding-top: 8px;
}
.related-section h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue);
  display: inline-block;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.related-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--dark);
  transition: transform .2s;
  display: block;
}
.related-card:hover { transform: translateY(-3px); text-decoration: none; }
.related-card img { width: 100%; height: 150px; object-fit: cover; }
.related-body { padding: 14px; }
.related-body p { font-size: .88rem; font-weight: 600; margin: 8px 0 4px; line-height: 1.4; color: var(--dark); }
.related-body small { color: var(--gray); font-size: .78rem; }

/* ── AdSense wrappers ─────────────────────────────────────── */
.ad-wrap { text-align: center; overflow: hidden; }
.ad-top  { background: var(--lgray); padding: 8px 0; border-bottom: 1px solid var(--border); }
.ad-mid  { margin: 20px 0; }
.ad-side { margin-bottom: 0; }
.ad-footer { margin: 16px 0 0; border-top: 1px solid var(--border); padding: 12px 0; }
.ad-in-grid { padding: 10px 0; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.75);
  margin-top: 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding: 40px 20px;
}
.footer-grid .site-logo { color: #fff; font-size: 1.3rem; display: block; margin-bottom: 10px; }
.footer-grid p { font-size: .85rem; margin-top: 6px; }
.footer-grid h5 { color: #fff; font-size: .9rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; }
.footer-grid a { display: block; color: rgba(255,255,255,.65); font-size: .85rem; margin-bottom: 7px; text-decoration: none; }
.footer-grid a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 20px;
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}

/* ── Empty / Error States ─────────────────────────────────── */
.empty-state {
  background: var(--white);
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  grid-column: 1/-1;
  box-shadow: var(--shadow);
}
.empty-state h2 { font-size: 1.6rem; margin-bottom: 10px; }
.empty-state p { color: var(--gray); margin-bottom: 10px; }
.warn-msg { background: #fff3e0; border: 1px solid #ffcc80; border-radius: 6px; padding: 10px 16px; font-size: .88rem; color: #e65100; display: inline-block; }

/* ── Static pages (About, Privacy, Contact) ──────────────── */
.static-page { max-width: 820px; margin: 40px auto; background: var(--white); border-radius: 12px; padding: 48px 52px; box-shadow: var(--shadow); }
.static-page h1 { font-size: 2rem; margin-bottom: 8px; }
.static-page .page-subtitle { color: var(--gray); font-size: 1rem; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.static-page h2 { font-size: 1.25rem; margin: 28px 0 10px; }
.static-page p { margin-bottom: 16px; color: #333; line-height: 1.75; }
.static-page ul { margin: 0 0 16px 22px; }
.static-page ul li { margin-bottom: 7px; color: #333; }
.contact-form { margin-top: 24px; }
.contact-form .form-group { margin-bottom: 18px; }
.contact-form label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
  font-family: var(--font);
  transition: border .2s;
  outline: none;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--blue); }
.contact-form textarea { height: 130px; resize: vertical; }
.submit-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 11px 30px;
  border-radius: 24px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.submit-btn:hover { background: var(--blue-dk); }

/* ── 404 page ─────────────────────────────────────────────── */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 h1 { font-size: 6rem; color: var(--blue); line-height: 1; }
.page-404 h2 { font-size: 1.8rem; margin: 10px 0 16px; }
.page-404 p  { color: var(--gray); margin-bottom: 24px; }
.page-404 a  { background: var(--blue); color: #fff; padding: 11px 28px; border-radius: 24px; font-weight: 700; text-decoration: none; }

/* ── Floating WhatsApp Button ─────────────────────────────── */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 24px;
  background: #25d366;
  color: #fff;
  font-size: 1.8rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.5);
  z-index: 9999;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.wa-float:hover { transform: scale(1.1); box-shadow: 0 6px 22px rgba(37,211,102,.65); text-decoration: none; }

/* ── Share Button — Copy Link ─────────────────────────────── */
.share-btn.cp {
  background: #f0f2f7;
  color: #333;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font);
  font-size: .8rem;
}
.share-btn.cp:hover { background: var(--border); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1/-1; }
}

@media (max-width: 768px) {
  .main-nav { display: none; flex-direction: column; gap: 2px; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 14px; font-size: .95rem; }
  .nav-toggle { display: block; }
  .hdr-inner { flex-wrap: wrap; }

  .page-layout, .post-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }

  .posts-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }

  .featured-img { min-height: 300px; }
  .featured-title { font-size: 1.3rem; }
  .article { padding: 22px 18px; }
  .article-title { font-size: 1.45rem; }
  .article-hero img { height: 240px; }
  .static-page { padding: 30px 22px; margin: 20px 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  .search-bar { display: none; }
  .ticker-bar { font-size: .75rem; }
  .featured-img { min-height: 240px; }
  .featured-body { padding: 18px; }
  .featured-title { font-size: 1.15rem; }
}
