/* ═══════════════════════════════════════════════════════
   GProTip — Main Stylesheet  v2.0  (production-ready)
   Mobile-first · Dark/Light · Zero JS dependencies
   ═══════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────── */
:root {
  --primary:        #e8192c;
  --primary-dark:   #b91220;
  --primary-light:  #ff3347;
  --primary-bg:     rgba(232,25,44,.08);

  --bg:             #f4f5f9;
  --bg-alt:         #ecedf3;
  --surface:        #ffffff;
  --surface-2:      #f8f9fc;
  --border:         #dde0ec;
  --border-light:   #e8eaf5;

  --text:           #0d0f1c;
  --text-muted:     #5c6372;
  --text-light:     #9299ab;

  --header-bg:      #0b0e18;
  --header-border:  #1a1f30;

  --shadow:         0 2px 12px rgba(0,0,0,.07);
  --shadow-md:      0 4px 24px rgba(0,0,0,.12);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.18);

  --font-display:   'Playfair Display', Georgia, serif;
  --font-body:      'Inter', system-ui, -apple-system, sans-serif;
  --font-ui:        'Inter', system-ui, -apple-system, sans-serif;

  --radius:         8px;
  --radius-lg:      14px;
  --transition:     .2s ease;
  --max-width:      1280px;
  --content-width:  820px;
}

[data-theme="dark"] {
  --bg:            #0b0e18;
  --bg-alt:        #111420;
  --surface:       #151922;
  --surface-2:     #1b2030;
  --border:        #242c3f;
  --border-light:  #1c2335;
  --text:          #e8ecf5;
  --text-muted:    #8590a6;
  --text-light:    #5a6478;
  --shadow:        0 2px 12px rgba(0,0,0,.5);
  --shadow-md:     0 4px 24px rgba(0,0,0,.6);
  --header-bg:     #06080f;
  --header-border: #151c2c;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

/* ── Reading Progress Bar ─────────────────────────────── */
#reading-progress {
  position: fixed; top: 0; left: 0; z-index: 9997;
  height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0); transform-origin: left;
  will-change: transform; transition: transform .1s linear;
}

/* ── Breaking News Ticker ─────────────────────────────── */
.news-ticker {
  background: var(--primary); color: #fff;
  font-family: var(--font-ui); font-size: .8rem; font-weight: 500;
  display: flex; align-items: center;
  height: 34px; overflow: hidden; position: relative; z-index: 50;
}
.ticker-label {
  flex-shrink: 0; background: rgba(0,0,0,.3);
  padding: 0 1rem; height: 100%;
  display: flex; align-items: center;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; font-size: .7rem; white-space: nowrap;
}
.ticker-track { flex: 1; overflow: hidden; position: relative; height: 100%; }
.ticker-content {
  display: flex; align-items: center; white-space: nowrap;
  position: absolute; top: 0; left: 0; height: 100%;
  will-change: transform; animation: ticker-scroll 35s linear infinite;
}
.ticker-content:hover { animation-play-state: paused; }
.ticker-content a { color: #fff; margin-right: 3rem; display: inline-flex; align-items: center; gap: .35rem; font-size: .79rem; }
.ticker-content a::before { content: "▶"; font-size: .45rem; opacity: .7; }
.ticker-content a:hover { text-decoration: underline; }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg);
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
  transition: box-shadow .2s;
  /* NO overflow:hidden — would clip dropdown portal */
}
.site-header.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.55); }

.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 1.25rem; height: 60px;
  display: flex; align-items: center; gap: .75rem;
  justify-content: space-between;
  /* NO overflow:hidden — clips dropdown menus */
}

/* ── Logo ──────────────────────────────────────────────── */
.site-logo {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800;
  color: #fff !important; letter-spacing: -.02em;
  flex-shrink: 0; display: flex; align-items: center; gap: .5rem;
  text-decoration: none; min-width: 0;
}
.site-logo-bar { width: 5px; height: 26px; background: var(--primary); border-radius: 3px; flex-shrink: 0; }
.site-logo img { height: 36px; width: auto; max-width: 160px; object-fit: contain; display: block; }

/* ── Main Nav ──────────────────────────────────────────── */
.main-nav {
  display: flex; align-items: center; gap: .05rem;
  flex: 1; min-width: 0;
  justify-content: flex-end;
  margin-left: 0;
  /* NO overflow:hidden — clips dropdown menus */
}
.main-nav a {
  font-family: var(--font-ui); font-weight: 500; font-size: .84rem;
  padding: .4rem .72rem; border-radius: 5px;
  color: rgba(235,240,255,.72);
  transition: background .15s, color .15s; white-space: nowrap;
}
.main-nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.main-nav a.active { background: rgba(232,25,44,.2); color: var(--primary-light); font-weight: 600; }

/* ── Desktop Dropdown Menus ────────────────────────────── */
/* nav-dropdown wrapper: position:relative, overflow:visible — critical */
.nav-dropdown { position: relative; overflow: visible; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;          /* flush — no gap so mouse travels straight in */
  left: 0;
  background: #13182a;
  border: 1px solid #242c3f;
  border-radius: 10px;
  min-width: 175px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  z-index: 9999;      /* above everything */
  padding: .5rem 0;
  animation: dropIn .15s ease;
  pointer-events: auto;
}
.dropdown-menu.align-right { left: auto; right: 0; }
@keyframes dropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.dropdown-menu a {
  display: block; padding: .48rem 1rem;
  font-size: .82rem; color: rgba(235,240,255,.75);
  white-space: nowrap; transition: background .1s, color .1s;
}
.dropdown-menu a:hover { background: rgba(255,255,255,.07); color: #fff; }
/* NO .nav-dropdown:hover CSS rule — JS handles all dropdown visibility */

/* ── Portaled User Dropdown (appended to <body> by JS) ── */
/* position:fixed so it escapes ALL stacking contexts       */
.dropdown-portal {
  position: fixed;
  z-index: 99999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 200px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
  padding: .4rem 0;
  white-space: nowrap;
  display: none;
  animation: dropIn .15s ease;
}
.dropdown-portal.open { display: block; }
.dropdown-portal a {
  display: block; padding: .5rem .9rem;
  font-size: .83rem; color: var(--text);
  transition: background .1s;
}
.dropdown-portal a:hover { background: var(--bg-alt); }
.dropdown-portal hr {
  border: none; border-top: 1px solid var(--border); margin: .25rem 0;
}
.dropdown-portal .portal-username {
  padding: .45rem .9rem;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
}

/* ── Nav Actions ───────────────────────────────────────── */
.nav-actions { display: flex; align-items: center; gap: .35rem; margin-left: .4rem; overflow: visible; }
.btn-search, .btn-theme, .btn-menu {
  width: 40px; height: 40px; border: none;
  background: rgba(255,255,255,.0); cursor: pointer;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: rgba(235,240,255,.85); font-size: 1.05rem;
  transition: background .15s, color .15s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.btn-search:hover, .btn-theme:hover, .btn-menu:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-menu { display: none; }
.btn-menu, #btn-menu { touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.btn-menu, #btn-menu { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* ── Header Auth Buttons ───────────────────────────────── */
.btn-register {
  padding: .38rem .8rem; font-size: .8rem; font-weight: 600;
  color: rgba(235,240,255,.8); border: 1px solid rgba(255,255,255,.15);
  border-radius: 7px; transition: all .15s; white-space: nowrap;
}
.btn-register:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-signin {
  padding: .38rem .9rem; font-size: .8rem; font-weight: 700;
  background: var(--primary); color: #fff !important;
  border-radius: 7px; border: none; transition: background .15s; white-space: nowrap;
}
.btn-signin:hover { background: var(--primary-dark); }

/* ── Search Overlay ────────────────────────────────────── */
.search-overlay {
  position: fixed; inset: 0; z-index: 9996;
  background: rgba(0,0,0,.7);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px; opacity: 0; visibility: hidden; transition: opacity .2s;
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-box {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 1.25rem; width: 100%; max-width: 680px;
  margin: 0 1rem; box-shadow: var(--shadow-lg);
}
.search-input-wrap {
  display: flex; align-items: center; gap: .75rem;
  border: 2px solid var(--border); border-radius: var(--radius); padding: .6rem 1rem;
}
.search-input-wrap:focus-within { border-color: var(--primary); }
.search-input { flex: 1; border: none; background: none; font-size: 1rem; color: var(--text); font-family: var(--font-ui); outline: none; }
.search-results-preview { margin-top: 1rem; max-height: 50vh; overflow-y: auto; }

/* ── Layout ────────────────────────────────────────────── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.main-content { padding: 1.75rem 0; }
.layout-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.75rem; align-items: start; }

/* ── Section Headers ───────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; padding-bottom: .6rem; border-bottom: 2px solid var(--border); }
.section-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.section-title::before { content: ''; display: inline-block; width: 4px; height: 20px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }
.section-more { font-size: .74rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: .2rem; }
.section-more:hover { text-decoration: underline; }

/* ── Hero ──────────────────────────────────────────────── */
.hero-section { margin-bottom: 2rem; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 2px; background: var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.hero-card { position: relative; overflow: hidden; background: #0b0e18; }
.hero-card:first-child { grid-column: 1/2; grid-row: 1/3; }
.hero-card img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; transition: transform .45s ease; }
.hero-card:hover img { transform: scale(1.04); }
.hero-card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.15) 55%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 1.25rem; }
.hero-card-overlay .cat-badge { background: var(--primary); color: #fff; font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: .2rem .55rem; border-radius: 4px; width: fit-content; margin-bottom: .5rem; }
.hero-card-overlay h2 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; color: #fff; line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.hero-card:not(:first-child) .hero-card-overlay h2 { font-size: 1rem; }
.hero-meta { font-size: .74rem; color: rgba(255,255,255,.7); margin-top: .4rem; }

/* ── Post Cards ────────────────────────────────────────── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.post-card-img { position: relative; overflow: hidden; aspect-ratio: 16/9; background: var(--bg-alt); flex-shrink: 0; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.cat-link { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); }
.post-card-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; line-height: 1.35; margin: .35rem 0 .5rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-excerpt { font-size: .85rem; color: var(--text-muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .75rem; color: var(--text-muted); flex-wrap: wrap; }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar { position: sticky; top: 76px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.widget-title { font-family: var(--font-display); font-size: .95rem; font-weight: 800; margin-bottom: .9rem; padding-bottom: .55rem; border-bottom: 2px solid var(--border); color: var(--text); display: flex; align-items: center; gap: .45rem; }
.widget-title::before { content: ''; display: inline-block; width: 4px; height: 17px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }

/* ── Tags ──────────────────────────────────────────────── */
.tags-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-pill { font-size: .75rem; font-weight: 500; padding: .28rem .65rem; border-radius: 2rem; background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-muted); transition: all .15s; }
.tag-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Article ───────────────────────────────────────────── */
.article-featured-image { width: 100%; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.75rem; }
.article-featured-image img { width: 100%; height: auto; max-height: 500px; object-fit: cover; }
.article-byline { display: flex; align-items: center; gap: .75rem; margin: 1rem 0 1.5rem; flex-wrap: wrap; }
.byline-avatar { width: 44px !important; height: 44px !important; min-width: 44px; border-radius: 50% !important; object-fit: cover !important; flex-shrink: 0; border: 2px solid var(--border); background: var(--bg-alt); }
.byline-name { font-weight: 700; font-size: .9rem; color: var(--text); text-decoration: none; transition: color .15s; }
.byline-name:hover { color: var(--primary); }
.byline-date, .byline-reading { font-size: .8rem; color: var(--text-muted); }
.author-card-avatar { width: 72px !important; height: 72px !important; min-width: 72px; border-radius: 50% !important; object-fit: cover !important; flex-shrink: 0; border: 3px solid var(--border); }
.article-title { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.18; letter-spacing: -.02em; margin-bottom: 1rem; }
.article-body { font-size: 1.05rem; line-height: 1.85; color: var(--text); }
.article-body h2 { font-family: var(--font-display); font-size: 1.6rem; margin: 2rem 0 .75rem; }
.article-body h3 { font-family: var(--font-display); font-size: 1.3rem; margin: 1.75rem 0 .6rem; }
.article-body p { margin-bottom: 1.4rem; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body img { width: 100%; border-radius: var(--radius); margin: 1.5rem 0; }
.article-body blockquote { border-left: 4px solid var(--primary); margin: 1.75rem 0; padding: .9rem 1.25rem; background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.1rem; font-style: italic; color: var(--text-muted); }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.article-body li { margin-bottom: .4rem; }
.article-body pre { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; overflow-x: auto; font-size: .88rem; margin: 1.5rem 0; }

/* Image safety */
.byline-avatar, .author-card-avatar, .post-card-img img, .hero-card img { margin: 0 !important; }
.byline-avatar { border-radius: 50% !important; }
.author-card-avatar { border-radius: 50% !important; }

/* ── Share Buttons ─────────────────────────────────────── */
.social-share { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .85rem; border-radius: 2rem; font-size: .78rem; font-weight: 600; cursor: pointer; border: none; transition: opacity .15s, transform .15s; color: #fff; white-space: nowrap; text-decoration: none; }
.share-btn:hover { opacity: .85; transform: translateY(-1px); }
.share-btn.twitter  { background: #000; }
.share-btn.facebook { background: #1877F2; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.telegram { background: #229ED9; }
.share-btn.copy     { background: #5a6172; }
.share-btn.copy.copied { background: #16a34a; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; }
.form-control { width: 100%; padding: .6rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: .9rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,25,44,.1); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ── Buttons ───────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.35rem; border: none; border-radius: var(--radius); font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--bg-alt); }

/* ── Badges ────────────────────────────────────────────── */
.badge { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .18rem .52rem; border-radius: 4px; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-yellow { background: #fef9c3; color: #ca8a04; }

/* ── Pagination ────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; padding: 2rem 0; list-style: none; }
.pagination li a { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); font-size: .88rem; color: var(--text); background: var(--surface); transition: all .15s; }
.pagination li a:hover, .pagination li a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Footer ────────────────────────────────────────────── */
.site-footer { background: #0b0e18; border-top: 3px solid var(--primary); padding: 3rem 0 0; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem 2.5rem; }
.footer-logo { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: .45rem; margin-bottom: .85rem; text-decoration: none; }
.footer-logo-bar { width: 5px; height: 24px; background: var(--primary); border-radius: 3px; flex-shrink: 0; }
.footer-about p { font-size: .85rem; color: #6b7a96; line-height: 1.65; }
.footer-col h4 { font-family: var(--font-ui); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1rem; color: #cbd5e1; padding-bottom: .5rem; border-bottom: 1px solid #1e2433; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin: .5rem 0; }
.footer-col ul li a { font-size: .84rem; color: #6b7a96; transition: color .15s; }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom { max-width: var(--max-width); margin: 0 auto; padding: 1rem 1.25rem; border-top: 1px solid #1a2030; display: flex; align-items: center; justify-content: space-between; font-size: .77rem; color: #4a5568; flex-wrap: wrap; gap: .75rem; }
.social-links { display: flex; gap: .45rem; }
.social-links a { width: 32px; height: 32px; border-radius: 50%; background: #161d2a; border: 1px solid #252d3f; display: flex; align-items: center; justify-content: center; color: #6b7a96; font-size: .85rem; transition: all .15s; }
.social-links a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.footer-newsletter-form { display: flex; gap: .4rem; margin-top: .75rem; }
.footer-newsletter-form input { flex: 1; padding: .5rem .75rem; border: 1px solid #252d3f; border-radius: 6px; background: #161d2a; color: #e2e8f0; font-size: .82rem; outline: none; transition: border-color .15s; }
.footer-newsletter-form input:focus { border-color: var(--primary); }
.footer-newsletter-form button { padding: .5rem .9rem; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s; }
.footer-newsletter-form button:hover { background: var(--primary-dark); }

/* ── Cookie Banner ─────────────────────────────────────── */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 2px solid var(--primary); padding: 1rem 1.5rem; z-index: 300; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; box-shadow: 0 -4px 20px rgba(0,0,0,.15); transform: translateY(100%); transition: transform .3s; }
.cookie-banner.show { transform: translateY(0); }

/* ── Scroll To Top ─────────────────────────────────────── */
.scroll-top { position: fixed; bottom: 1.25rem; right: 1.25rem; width: 42px; height: 42px; background: var(--primary); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); z-index: 50; opacity: 0; transform: translateY(10px); transition: all .2s; }
.scroll-top.show { opacity: 1; transform: translateY(0); }

/* ── Ads ───────────────────────────────────────────────── */
.ad-slot { width: 100%; overflow: hidden; background: var(--bg-alt); border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; min-height: 90px; display: flex; align-items: center; justify-content: center; margin: 1.5rem 0; font-size: .72rem; color: var(--text-muted); }

/* ── Utilities ─────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; } .align-center { align-items: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }

/* ── Skeleton Loading ───────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border) 50%, var(--bg-alt) 75%); background-size: 200% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--radius); }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Post Info Box ─────────────────────────────────────── */
.post-info-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 2px 16px rgba(0,0,0,.06); margin: 1.5rem 0; }
.pib-section { border-bottom: 1px solid var(--border); }
.pib-section:last-of-type { border-bottom: none; }
.pib-head { background: linear-gradient(135deg,#1e293b,#0f172a); color: #f1f5f9; font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; padding: .6rem 1rem; }

/* ── Reactions ─────────────────────────────────────────── */
.reactions { display: flex; gap: .45rem; flex-wrap: wrap; }
.reaction-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 2rem; padding: .38rem .85rem; cursor: pointer; font-size: .95rem; display: flex; align-items: center; gap: .3rem; transition: all .15s; }
.reaction-btn:hover, .reaction-btn.active { border-color: var(--primary); background: rgba(232,25,44,.07); color: var(--primary); }
.reaction-btn .count { font-size: .78rem; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════
   MOBILE MENU — Right-side slide panel
   z-index: 9999 — above sticky header (1000) and everything
   ══════════════════════════════════════════════════════════ */
.mobile-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65); z-index: 9998;
  opacity: 0; visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-overlay.open { opacity: 1; visibility: visible; }

.mobile-menu-panel {
  position: fixed; top: 0; right: 0;
  transform: translateX(102%);
  width: min(300px, 88vw);
  height: 100%; height: 100dvh; /* iOS URL bar fix */
  background: #0b0e18; z-index: 9999;
  display: flex; flex-direction: column;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,.6);
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  will-change: transform;
}
.mobile-menu-panel.open { transform: translateX(0); }

.mobile-menu-close {
  width: 36px; height: 36px; border: none;
  background: rgba(255,255,255,.07); border-radius: 50%;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.mobile-menu-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; border-bottom: 1px solid #1a2030; }
.mobile-menu-body { flex: 1; padding: .5rem 0; }
.mobile-menu-body a { display: flex; align-items: center; padding: .75rem 1.25rem; color: rgba(235,240,255,.8); font-size: .9rem; font-weight: 500; border-bottom: 1px solid #111827; transition: background .15s, color .15s; }
.mobile-menu-body a:hover { background: rgba(255,255,255,.06); color: #fff; }
.mobile-menu-body a.active { color: var(--primary-light); }
.mobile-menu-body .menu-section-label { padding: .85rem 1.25rem .3rem; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #374151; }
.mobile-menu-footer { padding: 1rem 1.1rem; border-top: 1px solid #1a2030; display: flex; gap: .5rem; }
.mobile-menu-footer a { flex: 1; padding: .6rem; text-align: center; border-radius: 8px; font-size: .85rem; font-weight: 600; }
.mobile-menu-footer .mm-login { background: var(--primary); color: #fff; }
.mobile-menu-footer .mm-login:hover { color: #fff; background: var(--primary-dark); }
.mobile-menu-footer .mm-register { background: rgba(255,255,255,.07); color: rgba(235,240,255,.8); border: 1px solid rgba(255,255,255,.12); }
.mobile-menu-footer .mm-logout { flex: 1; padding: .6rem; text-align: center; border-radius: 8px; font-size: .85rem; font-weight: 600; background: rgba(220,38,38,.15); color: #f87171; border: 1px solid rgba(220,38,38,.25); transition: background .15s; }
.mobile-menu-footer .mm-logout:hover { background: rgba(220,38,38,.25); color: #fca5a5; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════ */

/* ── Tablet ≤1024px ────────────────────────────────────── */
@media (max-width: 1024px) {
  .layout-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; top: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .hero-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Mobile ≤768px ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root { font-size: 15px; }

  .header-inner { padding: 0 1rem; height: 56px; gap: .5rem; }
  .site-logo { font-size: 1.25rem; }
  .site-logo img { height: 32px; max-width: 140px; }
  .site-logo-bar { height: 22px; }

  /* Hide desktop nav, show hamburger */
  .main-nav { display: none !important; }
  .nav-actions .btn-register,
  .nav-actions .btn-signin { display: none !important; }
  .nav-actions { gap: .2rem; margin-left: auto; flex-shrink: 0; }
  .btn-menu { display: flex !important; }

  .news-ticker { height: 30px; font-size: .74rem; }
  .ticker-label { padding: 0 .65rem; font-size: .65rem; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-card:first-child { grid-row: auto; }
  .hero-card img { min-height: 220px; }
  .hero-card-overlay h2 { font-size: 1.15rem; }
  .hero-card:not(:first-child) .hero-card-overlay h2 { font-size: .95rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; padding-bottom: 2rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .article-title { font-size: 1.6rem; }
  .container { padding: 0 .85rem; }
  .main-content { padding: 1.25rem 0; }
}

/* ── Small phones ≤480px ───────────────────────────────── */
@media (max-width: 480px) {
  .header-inner { gap: .3rem; padding: 0 .65rem; height: 52px; }
  .site-logo { font-size: 1rem; gap: .35rem; }
  .site-logo-bar { height: 18px; width: 4px; }
  .site-logo img { height: 28px; max-width: 110px; }
  .btn-search, .btn-theme { width: 32px; height: 32px; font-size: .88rem; }
  .btn-menu { width: 34px; height: 34px; }
  .share-btn span { display: none; }
  .share-btn { padding: .4rem .6rem; }
  .hero-card-overlay { padding: .85rem; }
  .post-card-body { padding: .85rem; }
  .widget { padding: .85rem 1rem; }

  /* Keep user dropdown within viewport */
  .nav-actions .nav-dropdown .dropdown-menu,
  .dropdown-portal { max-width: calc(100vw - 1rem); right: 0; left: auto; }
}

/* ── Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ticker-content { animation-play-state: paused !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body[data-reduced-motion="true"] .ticker-content { animation-play-state: paused !important; }

/* ── User menu portal (appended to body by JS, escapes all stacking contexts) */
.gp-user-portal {
  position: fixed; /* MUST be fixed — absolute breaks with scroll */
  z-index: 99999;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  min-width: 200px;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
  padding: .4rem 0;
  display: none;
  animation: dropIn .15s ease;
}
.gp-user-portal.open { display: block; }
.gp-user-portal a {
  display: block; padding: .5rem .9rem;
  font-size: .83rem; color: var(--text, #0d0f1a);
  white-space: nowrap; text-decoration: none;
  transition: background .1s;
}
.gp-user-portal a:hover { background: var(--bg-alt, #f1f5f9); }
.gp-user-portal .portal-sep { border: none; border-top: 1px solid var(--border, #e2e8f0); margin: .25rem 0; }
.gp-user-portal .portal-name {
  padding: .45rem .9rem;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted, #64748b);
}
@media (max-width: 480px) {
  .gp-user-portal { min-width: calc(100vw - 2rem); right: 1rem !important; left: auto !important; }
}
