/* espressonews.bg — header tools, footer, dark mode, lightbox (2026-09-15).
   Ported from storiesweneed.com. Loaded after site-v2.css. */

/* ---------- header extras ---------- */
.header-right { display: flex; align-items: center; gap: 8px; }
@media (min-width: 768px) { .header-right { position: absolute; right: 15px; top: 34px; margin-top: 0 !important; z-index: 20; } }
.hdr-search { display: flex; align-items: center; margin: 0; border: 1px solid transparent; border-radius: 999px; transition: border-color .2s, background .2s; }
.hdr-search input { width: 0; opacity: 0; border: 0; background: transparent; padding: 0; height: 36px; font: 14px var(--sans); color: var(--ink); outline: none; transition: width .25s, opacity .2s, padding .25s; }
.hdr-search.open { border-color: var(--rule); background: var(--card); }
.hdr-search.open input { width: 190px; opacity: 1; padding: 0 4px 0 14px; }
.hdr-search-btn, .theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.hdr-search-btn:hover, .theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.hdr-search-btn svg, .theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ico-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: block; }
html[data-theme="dark"] .theme-toggle .ico-sun { display: none; }
@media (max-width: 767px) { .header-right { display: none; } }
.mob-search { padding: 12px 20px; }
.mob-search input { width: 100%; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; padding: 9px 14px; font: 14px var(--sans); }
.mob-theme { display: flex; align-items: center; gap: 10px; padding: 4px 20px 14px; color: rgba(255,255,255,.75); font: 13px var(--sans); cursor: pointer; }
.mob-theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- footer ---------- */
/* the page template wraps this in <footer class="footer">, so the outer element carries
   the gap and the background; the inner one must not add a collapsing margin */
.footer { background: var(--footer-bg); margin-top: 60px; padding: 0; }
.site-footer { background: var(--footer-bg); color: rgba(255,255,255,.72); margin-top: 0; padding: 52px 0 30px; border-top: 4px solid var(--accent); font-family: var(--sans); }
.site-footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.4fr; gap: 36px; }
@media (max-width: 991px) { .site-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer-grid { grid-template-columns: 1fr; gap: 26px; } }
.sf-logo { display: inline-block; margin-bottom: 14px; }
.sf-logo img { height: 46px; width: auto; background: #fff; border-radius: 8px; padding: 5px 9px; }
.sf-brand p, .sf-contact p { font-size: 14px; line-height: 1.65; margin: 0 0 14px; }
.site-footer h4 { font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #fff; margin: 0 0 14px; }
.sf-col a { display: block; color: rgba(255,255,255,.72); font-size: 14.5px; margin-bottom: 9px; }
.sf-col a:hover, .sf-brand a:hover, .sf-contact a:hover { color: #fff; }
.sf-brand a, .sf-contact a { color: rgba(255,255,255,.72); }
.sf-social { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 10px; }
.sf-social a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 16px; }
.sf-social a:hover { background: var(--accent); color: #fff; }
.sf-tariff { display: inline-block; margin-top: 4px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.3); }
.sf-copy { margin: 40px 0 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: rgba(255,255,255,.5); }
#go-top-button { z-index: 50; }

/* ---------- dark mode ---------- */
html[data-theme="dark"] {
  --paper: #131518; --card: #1c1f23; --ink: #f1eeea; --body: #d4d0ca; --muted: #9b9995; --rule: #2d3136;
  --accent: #ef5f61; --accent-dark: #ff7d7e; --accent-soft: rgba(239,95,97,.18); --footer-bg: #0e1012;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.35); --shadow-hover: 0 2px 4px rgba(0,0,0,.4), 0 18px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}
html[data-theme="dark"] body, html[data-theme="dark"] body.light { background: var(--paper); color: var(--body); }
html[data-theme="dark"] .header { background: var(--card); border-bottom-color: var(--rule); }
html[data-theme="dark"] .navbar-nav > li > a, html[data-theme="dark"] .mega-menu .dropdown-menu > li > a { color: var(--ink); }
html[data-theme="dark"] .dropdown-menu, html[data-theme="dark"] .mega-menu .dropdown-menu { background: var(--card); }
html[data-theme="dark"] .mega-menu .dropdown-menu > li > a:hover { background: var(--paper); }
html[data-theme="dark"] .navbar-nav > li > a:not([href]) { color: var(--rule); }
html[data-theme="dark"] .news-block, html[data-theme="dark"] .news-details, html[data-theme="dark"] .big-block .news-details,
html[data-theme="dark"] .sidebar .widget, html[data-theme="dark"] .author-widget { background: var(--card); }
html[data-theme="dark"] .news-block .image-overlay { background: #25282d; }
html[data-theme="dark"] .post-content, html[data-theme="dark"] .post-wrapper { color: var(--body); }
html[data-theme="dark"] .post-content blockquote { color: var(--body); }
html[data-theme="dark"] .pagination > li > a, html[data-theme="dark"] .paging a, html[data-theme="dark"] .paging span { background: var(--card); color: var(--ink); border-color: var(--rule); }
html[data-theme="dark"] .tags-widget a, html[data-theme="dark"] .tagwidget a { background: var(--card); color: var(--muted); border-color: var(--rule); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .sb-search-input { background: var(--card); color: var(--ink); border-color: var(--rule); }
html[data-theme="dark"] .flex-direction-nav a { background: rgba(255,255,255,.12); color: #fff; }
html[data-theme="dark"] .post-wrapper .image-overlay img { opacity: .92; }
html[data-theme="dark"] .hdr-search.open { background: var(--paper); }
/* the wordmark is dark ink on transparent, so it needs a light plate on dark ground */
html[data-theme="dark"] .logo img { background: #fff; border-radius: 8px; padding: 5px 9px; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100000; background: rgba(12,12,12,.94); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lb img { max-width: 92vw; max-height: 84vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb figcaption { color: rgba(255,255,255,.7); font: 14px var(--sans); margin-top: 12px; text-align: center; }
.lb figcaption:empty { display: none; }
.lb button { position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb button:hover { background: var(--accent); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.post-wrapper a.popup-image, .post-content img.zoomable { cursor: zoom-in; }
html.lb-open, html.lb-open body { overflow: hidden; }
@media (max-width: 767px) { .lb button { width: 40px; height: 40px; font-size: 24px; } .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; } }
