/*
Theme Name: AllMobileCases
Theme URI: https://allmobilecases.com
Template: generatepress
Author: Furqan
Description: Child theme for allmobilecases.com — a tech-forward look for phone case reviews, comparisons and affiliate picks. Requires the free GeneratePress parent theme.
Version: 2.8
Text Domain: allmobilecases-child
*/

/* ============================================================
   DESIGN TOKENS — change these lines to retheme the whole site
   ============================================================ */
:root {
  --amc-ink:         #11131a;  /* body text */
  --amc-ink-soft:    #555b6e;  /* secondary text */
  --amc-bg:          #ffffff;  /* page background */
  --amc-surface:     #f4f6fb;  /* card / section background */
  --amc-accent:      #e00604;  /* brand red — matches logo */
  --amc-accent-dark: #a60402;  /* hover/active */
  --amc-good:        #1f9d55;  /* "pro" checkmarks */
  --amc-bad:         #d1413f;  /* "con" crosses */
  --amc-radius:      10px;
  --amc-radius-lg:   20px;
  --amc-font-head:  'Archivo', sans-serif;      /* headings */
  --amc-font-body:  'Source Sans 3', sans-serif;    /* body text */

  --amc-border:      #e7e9f2;
  --amc-accent-soft: #fce9e8;  /* tint backgrounds */
  --amc-good-soft:   #e8f8ee;
  --amc-bad-soft:    #fcebea;
  --amc-shadow-sm:   0 1px 2px rgba(17,19,26,0.06), 0 1px 1px rgba(17,19,26,0.04);
  --amc-shadow:      0 8px 24px rgba(17,19,26,0.08);
  --amc-shadow-lg:   0 20px 48px rgba(17,19,26,0.14);
  --amc-maxw-read:   740px;
  --amc-maxw-wide:   1180px;
}


/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--amc-bg);
  color: var(--amc-ink);
  font-family: var(--amc-font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amc-accent); color: #fff; }

h1, h2, h3, h4,
.entry-title, .site-title {
  font-family: var(--amc-font-head);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--amc-ink);
}
h2 { font-size: 1.7rem; margin-top: 2.4em; margin-bottom: 0.6em; }
h3 { font-size: 1.25rem; }
a { color: var(--amc-accent); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--amc-accent-dark); }
img { max-width: 100%; height: auto; border-radius: var(--amc-radius); }

/* Reading-width content well; wide container for grids/home */
.page .content-area { max-width: var(--amc-maxw-read); margin: 0 auto; float: none !important; width: 100% !important; }
.single .content-area { max-width: 1040px; margin: 0 auto; float: none !important; width: 100% !important; }
body.home .content-area,
.archive .content-area,
.blog .content-area { max-width: var(--amc-maxw-wide); margin: 0 auto; float: none !important; width: 100% !important; }
.site-content { max-width: var(--amc-maxw-wide); margin: 0 auto; padding: 0 20px; }

/* Full-width, reading-focused layout — no sidebar clutter */
#right-sidebar.widget-area.sidebar { display: none; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  background: var(--amc-bg);
  border-bottom: 1px solid var(--amc-border);
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--amc-bg) 92%, transparent);
}
.site-header .inside-header,
.site-header .site-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 20px;
}
.site-title a {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--amc-ink);
  letter-spacing: -0.02em;
}
.main-navigation a {
  font-family: var(--amc-font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--amc-ink-soft);
  padding: 8px 14px !important;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--amc-ink);
  background: var(--amc-surface);
}
.main-navigation ul { display: flex; align-items: center; gap: 2px; }

/* ============================================================
   HERO (Group block, class "amc-hero" — on the front page)
   ============================================================ */
.amc-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, var(--amc-accent-soft) 0%, var(--amc-bg) 100%);
  border-radius: var(--amc-radius-lg);
  padding: 4.5rem 2rem 3.5rem;
  margin: 2rem 0 3rem;
}
.amc-hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 260px;
  background: radial-gradient(60% 60% at 50% 50%, var(--amc-accent) 0%, transparent 70%);
  opacity: 0.12;
  pointer-events: none;
}
.amc-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 16ch;
  margin: 0 auto 0.6em;
}
.amc-hero p {
  color: var(--amc-ink-soft);
  font-size: 1.1rem;
  max-width: 54ch;
  margin: 0 auto 1.6em;
}
.amc-eyebrow {
  display: inline-block;
  font-family: var(--amc-font-head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amc-accent);
  background: var(--amc-accent-soft);
  padding: 0.35em 0.9em;
  border-radius: 999px;
  margin-bottom: 1.2em;
}

/* ============================================================
   BUTTONS — core WP buttons + GenerateBlocks buttons
   Use these as your affiliate CTA ("Check Price on Amazon")
   ============================================================ */
.wp-block-button__link,
.gb-button,
button:not(.wp-block-search__button):not(.menu-toggle) {
  background: var(--amc-accent) !important;
  color: #fff !important;
  border-radius: 999px !important;
  font-family: var(--amc-font-head);
  font-weight: 700;
  padding: 0.8em 1.8em !important;
  border: none !important;
  box-shadow: var(--amc-shadow-sm);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.wp-block-button__link:hover,
.gb-button:hover,
button:hover {
  background: var(--amc-accent-dark) !important;
  transform: translateY(-2px);
  box-shadow: var(--amc-shadow);
}
.wp-block-buttons { margin: 1.6em 0; }

/* Outline / secondary CTA — add class "is-style-outline" in the block editor */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent !important;
  color: var(--amc-accent) !important;
  border: 2px solid var(--amc-accent) !important;
  box-shadow: none;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--amc-accent-soft) !important; }

/* ============================================================
   CARDS / CALLOUT BOX
   In the editor: select a Group block → Advanced → Additional CSS class → "amc-callout"
   ============================================================ */
.amc-callout {
  background: var(--amc-surface);
  border-left: 4px solid var(--amc-accent);
  border-radius: var(--amc-radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

/* "Best pick" highlight card — add class "amc-pick" to a Group block */
.amc-pick {
  position: relative;
  background: var(--amc-bg);
  border: 1px solid var(--amc-border);
  border-radius: var(--amc-radius-lg);
  padding: 1.75rem 2rem;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--amc-shadow);
}
.amc-pick::before {
  content: "✓ Our Pick";
  position: absolute;
  top: -12px;
  left: 1.75rem;
  background: var(--amc-good);
  color: #fff;
  font-family: var(--amc-font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35em 0.8em;
  border-radius: 999px;
}
.amc-pick h3 { margin-top: 0.3em; }

/* ============================================================
   PROS / CONS
   In the editor: use a Columns block (2 cols). Add class "amc-pros" to
   the left column's content, "amc-cons" to the right. List items get
   a check or cross automatically.
   ============================================================ */
.amc-pros, .amc-cons {
  border-radius: var(--amc-radius);
  padding: 1.25rem 1.5rem;
}
.amc-pros { background: var(--amc-good-soft); }
.amc-cons { background: var(--amc-bad-soft); }
.amc-pros li, .amc-cons li {
  list-style: none;
  padding-left: 1.6em;
  position: relative;
  margin-bottom: 0.5em;
}
.amc-pros li::before {
  content: "✓";
  color: var(--amc-good);
  font-weight: 700;
  position: absolute;
  left: 0;
}
.amc-cons li::before {
  content: "✕";
  color: var(--amc-bad);
  font-weight: 700;
  position: absolute;
  left: 0;
}

/* ============================================================
   COMPARISON TABLE — core Table block
   ============================================================ */
.wp-block-table {
  border-radius: var(--amc-radius);
  overflow: hidden;
  box-shadow: var(--amc-shadow-sm);
  margin: 1.5rem 0;
}
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table th {
  background: var(--amc-ink);
  color: #fff;
  font-family: var(--amc-font-head);
  text-align: left;
  padding: 0.75em 1em;
}
.wp-block-table td { padding: 0.75em 1em; border-bottom: 1px solid var(--amc-border); }
.wp-block-table tr:nth-child(even) td { background: var(--amc-surface); }

/* ============================================================
   AFFILIATE DISCLOSURE BANNER
   Add class "amc-disclosure" to a Paragraph block, place near top of post
   ============================================================ */
.amc-disclosure {
  background: #fff7e6;
  border: 1px solid #f3e0a8;
  border-radius: var(--amc-radius);
  font-size: 0.85rem;
  color: var(--amc-ink-soft);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

/* ============================================================
   HOME / ARCHIVE — Query Loop post grid
   In the editor: a Query Loop block renders this markup automatically
   ============================================================ */
.wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}
.wp-block-post-template > li {
  background: var(--amc-bg);
  border: 1px solid var(--amc-border);
  border-radius: var(--amc-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--amc-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wp-block-post-template > li:hover {
  transform: translateY(-4px);
  box-shadow: var(--amc-shadow-lg);
}
.wp-block-post-title { font-size: 1.2rem; margin: 0 0 0.5em; }
.wp-block-post-title a { color: var(--amc-ink); }
.wp-block-post-date {
  font-family: var(--amc-font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amc-accent);
  margin-bottom: 0.6em;
}
.wp-block-post-excerpt { color: var(--amc-ink-soft); font-size: 0.95rem; }
.wp-block-post-excerpt__more-link,
.wp-block-read-more {
  display: inline-block;
  margin-top: 0.8em;
  font-family: var(--amc-font-head);
  font-weight: 700;
  font-size: 0.9rem;
}
.wp-block-query { margin: 0; }

/* Classic blog loop (archives / search results) as cards too */
.post, article.post {
  background: var(--amc-bg);
  border: 1px solid var(--amc-border);
  border-radius: var(--amc-radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--amc-shadow-sm);
}
.entry-title a { color: var(--amc-ink); }
.entry-title a:hover { color: var(--amc-accent); }
.entry-meta { color: var(--amc-ink-soft); font-size: 0.85rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer, #colophon {
  background: var(--amc-ink);
  color: #c6cad6;
  margin-top: 4rem;
}
.site-footer .inside-footer,
.site-footer .site-content {
  padding: 2.5rem 20px;
  text-align: center;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--amc-accent); }

/* ============================================================
   RESPONSIVE — GeneratePress handles the grid; only override spacing
   ============================================================ */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .entry-title { font-size: 1.7rem; line-height: 1.25; }
  .site-content { padding: 0; }
  article, .inside-article { padding-left: 14px !important; padding-right: 14px !important; }
  .amc-callout, .amc-pick { padding: 1.25rem; }
  .amc-hero { padding: 3rem 1.25rem 2.25rem; }
  h2 { font-size: 1.4rem; }
  .wp-block-post-template { grid-template-columns: 1fr; }
}

/* Front page: hide the default auto page title — the hero block replaces it */
body.home .entry-header { display: none; }


/* ===== PROS/CONS COLUMN HEIGHT FIX ===== */
.wp-block-columns { align-items: stretch; }
.amc-pros, .amc-cons { height: 100%; box-sizing: border-box; }

.amc-product-img img { max-width: 320px; height: auto; border-radius: var(--amc-radius); box-shadow: var(--amc-shadow-sm); }
.amc-product-img { margin: 1.5rem auto; }


/* ---------------------------------------------------------------
   POST SIDEBAR — Table of Contents + Quick Facts
   Floated box inside the post content (not the theme's widget sidebar),
   so it can be authored per-post alongside the rest of the content.
   --------------------------------------------------------------- */
.amc-sidebar {
  float: right;
  width: 300px;
  margin: 4px 0 28px 36px;
  background: #fff;
  border: 1px solid var(--amc-border);
  border-radius: var(--amc-radius);
  box-shadow: var(--amc-shadow-sm);
  padding: 22px 24px;
  position: sticky;
  top: 96px;
}
.amc-sidebar h4 {
  font-family: var(--amc-font-head);
  font-size: 1rem;
  margin: 0 0 12px 0;
}
.amc-toc {
  list-style: none;
  margin: 0 0 24px 0;
  padding: 0;
}
.amc-toc li { margin: 0 0 10px 0; }
.amc-toc a {
  font-size: 0.95rem;
  color: var(--amc-ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--amc-border);
}
.amc-toc a:hover { color: var(--amc-accent); }
.amc-quickfacts { margin: 0; }
.amc-quickfacts dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a8a8a;
  margin-top: 14px;
}
.amc-quickfacts dt:first-child { margin-top: 0; }
.amc-quickfacts dd {
  margin: 2px 0 0 0;
  font-weight: 700;
  font-size: 1rem;
}
@media (max-width: 900px) {
  .amc-sidebar { float: none; width: 100%; position: static; margin: 0 0 28px 0; }
}


/* ---------------------------------------------------------------
   POST CONTENT WIDTH FIX (v2.7)
   .amc-sidebar floats right inside .entry-content, but Gutenberg's
   flex columns block (used for pros/cons) renders at the full
   entry-content width regardless of the float, so it visually runs
   under the sticky sidebar as the page scrolls. Cap every other
   direct child of entry-content to the width actually available
   beside the sidebar (300px box + 36px gap = 336px), and force the
   pros/cons columns to stack instead of sitting side by side so
   they read cleanly in the narrower space.
   --------------------------------------------------------------- */
.single .entry-content > *:not(.amc-sidebar) {
  max-width: calc(100% - 336px);
}
.single .entry-content .wp-block-columns {
  flex-wrap: wrap;
}
.single .entry-content .wp-block-columns > .wp-block-column {
  flex-basis: 100% !important;
  width: 100% !important;
}
@media (max-width: 900px) {
  .single .entry-content > *:not(.amc-sidebar) {
    max-width: 100%;
  }
}