/*
Theme Name: SGAMLY
Theme URI: https://sgamly.it
Author: SGAMLY
Description: Tema per sito di offerte, coupon e errori di prezzo, collegato al canale Telegram SGAMLY. Include tipi di contenuto Offerte e Coupon, tassonomie Negozi e Categorie, home con hero, griglie, negozi popolari e blog.
Version: 1.3.3
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: sgamly
*/

:root {
  --bg: #0e1020;
  --bg-2: #15182c;
  --card: #1b1f38;
  --line: #2a2f50;
  --text: #eef0fb;
  --muted: #9aa0c4;
  --accent: #ff3d6e;
  --accent-2: #ffa033;
  --ok: #2fd18a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; }
.section-head a { color: var(--muted); font-size: .95rem; white-space: nowrap; }
.section-head a:hover { color: var(--accent); }

.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 .95rem/1 var(--font); color: #fff; background: var(--accent);
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(255,61,110,.35); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); box-shadow: none; }
.btn-tg { background: #229ed9; }
.btn-tg:hover { box-shadow: 0 8px 20px rgba(34,158,217,.4); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Top bar */
.topbar { background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.topbar .container { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.topbar a:hover { color: var(--accent-2); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(14,16,32,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 900; font-size: 1.6rem; letter-spacing: -.03em; }
.logo span { color: var(--accent); }
.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo img { height: 44px; width: auto; max-width: none; display: block; }
.site-footer .logo img { height: 48px; }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--text); background: var(--card); }
.header-cta { display: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 12px; font-size: 1.1rem; cursor: pointer; margin-left: auto; }

.search-form { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.search-form input[type="search"] { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); padding: 11px 16px; font: inherit; outline: none; }
.search-form button { background: var(--accent); color: #fff; border: 0; padding: 0 18px; cursor: pointer; font-weight: 700; }
.header-search { flex: 1; max-width: 360px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; background:
  radial-gradient(900px 400px at 85% -10%, rgba(255,61,110,.25), transparent 60%),
  radial-gradient(700px 400px at 0% 110%, rgba(255,160,51,.12), transparent 60%); }
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 900; margin-bottom: .35em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 600px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 28px; padding: 0; list-style: none; }
.hero-badges li { background: var(--card); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; font-size: .92rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Value strip */
.strip { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.strip-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.strip-item .ico { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.strip-item h3 { font-size: 1.05rem; margin-bottom: .3em; }
.strip-item p { color: var(--muted); margin: 0; font-size: .95rem; }

/* Category chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--card); border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.chip small { color: var(--muted); margin-left: 6px; }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Grids and cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, border-color .18s, box-shadow .18s; position: relative; }
.card:hover { transform: translateY(-3px); border-color: #3b4170; box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4/3; background: #fff; display: block; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.card-media .ph { display: grid; place-items: center; height: 100%; font-size: 3rem; background: var(--bg-2); }
.badge-row { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; z-index: 2; }
.badge { padding: 5px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--accent); color: #fff; }
.badge.alt { background: var(--accent-2); color: #1a1300; }
.badge.ok { background: var(--ok); color: #04200f; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-store { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.card-title { font-size: 1.02rem; margin: 0; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--accent); }
.price { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.price .now { font-size: 1.5rem; font-weight: 900; color: var(--text); }
.price .old { color: var(--muted); text-decoration: line-through; }
.card-foot { padding: 0 16px 16px; }
.meta-line { color: var(--muted); font-size: .85rem; }
.expired { opacity: .55; }

/* Coupon card */
.coupon-card .coupon-top { padding: 18px 16px 0; display: flex; align-items: center; gap: 12px; }
.coupon-logo { flex: none; width: 56px; height: 56px; border-radius: 12px; background: #fff; display: grid; place-items: center; padding: 6px; overflow: hidden; }
.coupon-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.coupon-pct { font-size: 1.8rem; font-weight: 900; color: var(--accent); line-height: 1; }
.coupon-code { margin: 12px 16px 16px; display: flex; border: 2px dashed var(--accent-2); border-radius: 12px; overflow: hidden; }
.coupon-code .code { flex: 1; padding: 12px; font: 800 1rem ui-monospace, Menlo, monospace; letter-spacing: .08em; text-align: center; background: var(--bg-2); filter: blur(5px); user-select: none; transition: filter .2s; }
.coupon-code.revealed .code { filter: none; user-select: all; }
.coupon-code button { border: 0; background: var(--accent-2); color: #1a1300; font-weight: 800; padding: 0 16px; cursor: pointer; }

/* Stores */
.stores { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.store-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 12px; text-align: center; font-weight: 800; transition: .18s; }
.store-tile small { display: block; color: var(--muted); font-weight: 500; margin-top: 4px; }
.store-tile:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }

/* Telegram banner */
.tg-banner { background: linear-gradient(135deg, #1b2a52, #1b1f38 60%); border: 1px solid var(--line); border-radius: 24px; padding: 40px 28px; display: grid; gap: 18px; text-align: center; justify-items: center; }
.tg-banner h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); margin: 0; }
.tg-banner p { color: var(--muted); max-width: 520px; margin: 0; }

/* Blog */
.post-card .card-body { gap: 6px; }
.post-date { color: var(--muted); font-size: .85rem; }

/* Single */
.single-wrap { display: grid; gap: 28px; padding: 36px 0; }
@media (min-width: 860px) { .single-wrap.has-aside { grid-template-columns: 1.1fr 1fr; } }
.single-media { background: #fff; border-radius: var(--radius); padding: 20px; display: grid; place-items: center; }
.single-media img { max-height: 460px; width: auto; object-fit: contain; }
.single-info h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.single-info .price .now { font-size: 2.4rem; }
.notice { background: var(--bg-2); border: 1px solid var(--line); border-left: 4px solid var(--accent-2); padding: 12px 16px; border-radius: 10px; color: var(--muted); font-size: .88rem; margin: 18px 0; }
.entry-content { color: #d5d8f0; }
.entry-content a { color: var(--accent-2); text-decoration: underline; }
.entry-content img { border-radius: 12px; }
.breadcrumbs { color: var(--muted); font-size: .88rem; padding-top: 20px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 32px; }
.pagination .page-numbers { padding: 9px 15px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.pagination .current { background: var(--accent); border-color: var(--accent); }

.page-title-bar { padding: 40px 0 8px; }
.page-title-bar h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .2em; }
.page-title-bar p { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 26px; }

/* Footer */
.site-footer { margin-top: 40px; background: var(--bg-2); border-top: 1px solid var(--line); padding: 44px 0 24px; color: var(--muted); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h4 { color: var(--text); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:hover { color: var(--accent-2); }
.disclaimer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .82rem; }

/* Mobile */
@media (max-width: 860px) {
  .header-search { display: none; }
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; margin: 0; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .mobile-search { display: block; margin-top: 10px; }
  .hero { padding: 48px 0 36px; }
}
@media (min-width: 861px) {
  .mobile-search { display: none; }
  .header-cta { display: inline-flex; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 12px; }
  .card-foot { padding: 0 12px 12px; }
  .price .now { font-size: 1.2rem; }
  .topbar .tb-right { display: none; }
}
