/*
Theme Name: Student Discount Finder
Theme URI: https://studentdiscountfinder.com
Author: Owomide Balogun
Description: Custom theme for studentdiscountfinder.com (React-to-WP port)
Version: 1.13
Text Domain: student-discount-finder
*/

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --text: #0f172a;
  --muted: #6b7280;
}
*,
*::before,
*::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.header-app {
  background: #fff;
  border-bottom: 1px solid rgba(15,23,42,.03);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  font-size: 1.4rem;
  color: #4f46e5;
}
.top-nav {
  display: flex;
  gap: 1.3rem;
  align-items: center;
}
.top-nav a.is-active,
.top-nav a:hover {
  color: #4f46e5;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
}
.btn-primary {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: .7rem;
  padding: .6rem 1.3rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover {
  background: #4338ca;
}
.btn-secondary {
  background: #e5e7eb;
  color: #0f172a;
  border: none;
  border-radius: .7rem;
  padding: .6rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

/* hero */
.hero-sdf {
  background: linear-gradient(180deg,#ffffff 0%,#f3f4f6 100%);
  border-radius: 0 0 2.5rem 2.5rem;
  padding: 3.3rem 1rem 3.6rem;
  text-align: center;
  margin: -1.5rem -1.25rem 1.8rem;
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.hero-sdf h1 {
  font-size: clamp(2.6rem,4vw,3.3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero-sdf h1 span { color: #4f46e5; }
.hero-sdf p {
  color: #6b7280;
  max-width: 540px;
  margin: .6rem auto 1.4rem;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.section-title { text-align:center; margin-bottom:1.4rem; }
.subtle-ad {
  background:#fff;
  border:1px dashed #d1d5db;
  border-radius:1.4rem;
  padding:1.5rem;
  text-align:center;
  margin-bottom:1.3rem;
}

.filters-row {
  display:flex;
  gap:1rem;
  align-items:center;
  margin-bottom:1.25rem;
  overflow-x:auto;
}
.filter-scroller { display:flex; gap:.75rem; }
.filter-pill {
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:999px;
  padding:.4rem 1rem;
  font-weight:500;
  cursor:pointer;
  white-space:nowrap;
}
.filter-pill.is-active {
  background:#4f46e5;
  color:#fff;
  border-color:transparent;
}

.discount-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(245px,1fr));
  gap:1.25rem;
}
.discount-card {
  background:#fff;
  border-radius:1.5rem;
  padding:1.1rem 1.1rem 1.25rem;
  box-shadow:0 14px 50px rgba(15,23,42,0.04);
}
.discount-card-top {
  display:flex;
  gap:.8rem;
  align-items:center;
  margin-bottom:.7rem;
}
.avatar {
  width:48px;
  height:48px;
  border-radius:999px;
  background:#0f172a;
  background-size:cover;
  background-position:center;
}
.discount-card-title { font-weight:700; }
.discount-card-cat {
  font-size:.7rem;
  background:rgba(79,70,229,.12);
  color:#4f46e5;
  padding:.25rem .6rem;
  border-radius:999px;
  display:inline-block;
  margin-top:.2rem;
}
.discount-card p { font-size:.85rem; color:#4b5563; }
.discount-card .btn-get-code {
  margin-top:.7rem;
  display:inline-block;
  width:100%;
  text-align:center;
  background:#4f46e5;
  color:#fff;
  border-radius:.7rem;
  padding:.6rem .7rem;
  font-weight:600;
}

/* blog cards */
.blog-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:1.25rem;
}
.blog-card {
  background:#fff;
  border-radius:1.2rem;
  overflow:hidden;
  box-shadow:0 10px 25px rgba(15,23,42,.03);
  display:flex;
  flex-direction:column;
}
.blog-card-body {
  padding:1rem 1.05rem 1.15rem;
}
.blog-card-title { font-weight:700; margin-bottom:.4rem; }
.blog-card-meta { font-size:.75rem; color:#94a3b8; margin-bottom:.4rem; }
.blog-card-excerpt { color:#4b5563; margin-bottom:.6rem; }
.blog-card .more { color:#4f46e5; font-weight:600; }

/* modal */
.modal-backdrop,
.code-modal-backdrop {
  position:fixed; inset:0; background:rgba(15,23,42,.45);
  display:none; align-items:center; justify-content:center; z-index:60;
}
.modal-backdrop.is-open,
.code-modal-backdrop.is-open { display:flex; }
.modal-window,
.code-modal-window {
  background:#fff;
  width:min(540px,92%);
  border-radius:1.2rem;
  box-shadow:0 30px 60px rgba(15,23,42,.2);
}
.modal-head,
.code-modal-head {
  padding:1.2rem 1.3rem .4rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.modal-body,
.code-modal-body {
  padding:1rem 1.3rem 1.3rem;
}
.form-field { margin-bottom:.9rem; }
.form-control {
  width:100%; border:1px solid #e2e8f0; border-radius:.65rem;
  padding:.5rem .55rem; background:#f8fafc;
}
.form-control:focus { border-color:#4f46e5; background:#fff; }
.modal-actions { display:flex; gap:.6rem; justify-content:flex-end; }
.code-box {
  border:2px dashed #e2e8f0;
  border-radius:.9rem;
  background:#f8fafc;
  text-align:center;
  padding:1.1rem .5rem;
  font-weight:700;
  font-size:1.6rem;
  letter-spacing:.25rem;
  color:#4f46e5;
  margin-bottom:1rem;
}

/* footer like screenshot */
.sdf-footer {
  background: #1f2937;
  color: #e5e7eb;
  padding: 2.75rem 1.25rem 2.2rem;
  margin-top: 2.4rem;
}
.sdf-footer__inner {
  max-width: 1120px;
  margin: 0 auto 1.75rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.4rem;
  align-items: flex-start;
}
.sdf-footer__logo {
  font-weight: 700;
  font-size: 1.55rem;
  color: #fff;
  margin-bottom: .7rem;
}
.sdf-footer__text {
  color: #d1d5db;
  line-height: 1.5;
  max-width: 260px;
  margin-bottom: 1.1rem;
}
.sdf-footer__social {
  display: flex;
  gap: .55rem;
  align-items: center;
}
.sdf-footer__links h4,
.sdf-footer__legal h4 {
  color: #fff;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.sdf-footer__links a,
.sdf-footer__legal a {
  display: block;
  color: #e5e7eb;
  margin-bottom: .5rem;
  font-size: .9rem;
}
.sdf-footer__links a:hover,
.sdf-footer__legal a:hover {
  color: #fff;
}
.sdf-footer__divider {
  border: none;
  border-top: 1px solid rgba(229,231,235,0.08);
  max-width: 1120px;
  margin: 0 auto 1.4rem;
}
.sdf-footer__bottom {
  text-align: center;
  color: #e5e7eb;
  font-size: .85rem;
}

/* responsive */
@media(max-width: 960px) {
  .top-nav {
    position:absolute;
    top:64px;
    right:1rem;
    background:#fff;
    flex-direction:column;
    align-items:flex-start;
    padding:.7rem 1rem;
    border-radius:1rem;
    box-shadow:0 20px 40px rgba(0,0,0,.1);
    display:none;
  }
  .top-nav.is-open { display:flex; }
  .menu-toggle { display:block; }
  .sdf-footer__inner { grid-template-columns:1fr 1fr; }
  .hero-sdf { margin:-1.25rem -.85rem 1.3rem; }
}
@media(max-width: 640px) {
  .page-shell { padding:1.2rem .85rem 3rem; }
  .sdf-footer__inner { grid-template-columns:1fr; }
  .hero-sdf h1 { font-size:2.35rem; }
}

/* === Enhanced Responsiveness === */
@media (max-width: 1200px) {
  .page-shell { max-width: 100%; }
  .discount-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .blog-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}

@media (max-width: 900px) {
  .hero-sdf { padding: 2.5rem 1rem 3rem; }
  .hero-sdf h1 { font-size: 2.2rem; }
  .filters-row { flex-wrap: wrap; }
  .filters-row input { width: 100%; max-width: none; }
  .discount-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .sdf-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .hero-sdf { margin: -1.2rem -0.85rem 1.2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .discount-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .filters-row { gap: .5rem; }
  .filter-scroller { width: 100%; overflow-x: auto; }
  .filter-pill { font-size: .85rem; }
  .header-inner { gap: .5rem; }
  .brand { font-size: 1.25rem; }
}

@media (max-width: 520px) {
  .hero-sdf h1 { font-size: 2rem; }
  .hero-sdf p { font-size: .9rem; }
  .discount-card,
  .blog-card { border-radius: 1rem; }
  .modal-window,
  .code-modal-window { width: 94%; }
  .sdf-footer { padding-inline: 1rem; }
  .sdf-footer__inner { grid-template-columns: 1fr; }
  .sdf-footer__text { max-width: none; }
  .top-nav { right: .5rem; }
}

@media (max-width: 400px) {
  .hero-sdf h1 { font-size: 1.75rem; }
  .hero-actions .btn-primary,
  .hero-actions .btn-secondary { width: 100%; text-align: center; }
  .filters-row input { font-size: .8rem; }
}

/* === Overflow & Mobile Fixes === */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.page-shell {
  overflow-x: hidden;
}

.hero-sdf {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.filters-row {
  width: 100%;
  overflow-x: hidden;
}

.filter-scroller {
  display: flex;
  gap: .75rem;
  min-width: min(100%, 100vw - 2.4rem);
}

@media (max-width: 960px) {
  .top-nav {
    right: .75rem;
    width: calc(100% - 1.5rem);
  }
}

@media (max-width: 640px) {
  .hero-sdf {
    margin-left: auto;
    margin-right: auto;
    border-radius: 0 0 1.6rem 1.6rem;
  }
  .filters-row {
    gap: .4rem;
  }
  .filter-scroller {
    overflow-x: auto;
  }
  .discount-card,
  .blog-card {
    max-width: 100%;
  }
}

/* modal width safety */
.modal-window,
.code-modal-window {
  max-width: min(540px, 100vw - 2rem);
}

/* === Ad Blocks (non-intrusive) === */
.sdf-ad {
  background: #fff;
  border: 1px dashed rgba(148,163,184,.6);
  border-radius: 1.2rem;
  padding: 1.1rem 1rem;
  text-align: center;
  color: #0f172a;
  font-size: .78rem;
  line-height: 1.4;
}
.sdf-ad--banner {
  min-height: 90px;
}
.sdf-ad small {
  display: block;
  color: #94a3b8;
  margin-bottom: .25rem;
  font-size: .7rem;
  letter-spacing: .08em;
}
.sdf-ad--inline {
  margin: 1.2rem 0;
}
.sdf-ad--sidebar {
  background: #fff;
  border-radius: 1rem;
  border: 1px dashed rgba(148,163,184,.4);
  padding: 1rem;
}
@media (max-width: 720px) {
  .sdf-ad--banner {
    margin-inline: auto;
  }
  .sdf-ad--sidebar {
    display: none;
  }
}
