/*
Theme Name: Solve the Case Files
Theme URI: https://solvethecasefiles.com
Author: Solve the Case Files
Description: A mobile-first WooCommerce theme for printable and online detective case files.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: solve-the-case-files
*/

:root {
  --ink: #17221f;
  --ink-soft: #273530;
  --paper: #f6f2e9;
  --paper-deep: #e9e2d3;
  --white: #fffdf8;
  --muted: #6a746e;
  --line: #d8d1c3;
  --accent: #b85c3d;
  --accent-dark: #913e29;
  --brass: #c9a66b;
  --success: #477260;
  --shadow: 0 18px 48px rgba(23, 34, 31, .10);
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
body, button, input, select, textarea { font-family: var(--sans); }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
button, .button, .wp-element-button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit { border: 0; border-radius: 4px; background: var(--accent); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; font-weight: 750; letter-spacing: .02em; padding: .88rem 1.2rem; text-decoration: none; transition: background .18s ease, transform .18s ease; }
button:hover, .button:hover, .wp-element-button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { color: #fff; background: var(--accent-dark); transform: translateY(-1px); }
input, select, textarea { border: 1px solid var(--line); border-radius: 4px; color: var(--ink); padding: .75rem .85rem; max-width: 100%; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--white); padding: 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.container { width: min(1180px, calc(100% - 44px)); margin-inline: auto; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.section { padding: 5rem 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-heading h2 { margin: .35rem 0 0; font: 500 clamp(2rem, 4vw, 3.2rem)/1.05 var(--serif); letter-spacing: -.035em; }
.section-heading p { max-width: 420px; margin: 0; color: var(--muted); }

/* Header */
.site-header { position: relative; z-index: 20; background: var(--ink); color: var(--white); border-bottom: 1px solid rgba(255,255,255,.12); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--white); }
.brand:hover { color: var(--white); }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid var(--brass); border-radius: 50%; color: var(--brass); font: 700 1.4rem var(--serif); }
.brand-name { display: block; font: 700 1.08rem/1.05 var(--serif); letter-spacing: .025em; }
.brand-tagline { display: block; margin-top: .24rem; color: #c2c8c1; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 1.7rem; }
.site-nav ul, .footer-nav ul { display: contents; margin: 0; padding: 0; list-style: none; }
.site-nav li, .footer-nav li { list-style: none; }
.site-nav a { color: #e6e7e1; font-size: .9rem; font-weight: 650; text-decoration: none; }
.site-nav a:hover { color: var(--brass); }
.site-nav .nav-account { border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: .57rem .78rem; }
.cart-link { display: inline-flex; align-items: center; gap: .45rem; }
.cart-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: white; font-size: .72rem; }
.menu-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.35); color: white; padding: .55rem .7rem; }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--white); padding: 5.8rem 0 6.2rem; }
.hero:before { content: ""; position: absolute; width: 610px; height: 610px; right: -150px; top: -260px; border: 1px solid rgba(201,166,107,.24); border-radius: 50%; box-shadow: 0 0 0 42px rgba(201,166,107,.025), 0 0 0 88px rgba(201,166,107,.025); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); gap: 4rem; align-items: center; position: relative; }
.hero .eyebrow { color: var(--brass); }
.hero h1 { max-width: 740px; margin: .8rem 0 1.15rem; font: 500 clamp(3.25rem, 7.1vw, 6.4rem)/.98 var(--serif); letter-spacing: -.055em; }
.hero h1 em { color: var(--brass); font-style: normal; }
.hero-copy { max-width: 580px; color: #d1d6cf; font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.button-light { background: var(--paper); color: var(--ink); }
.button-light:hover { color: var(--ink); background: white; }
.hero-note { display: flex; align-items: center; gap: .55rem; margin-top: 1.45rem; color: #b9c0b9; font-size: .82rem; }
.hero-note:before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(71,114,96,.2); }
.hero-file { position: relative; width: min(100%, 420px); min-height: 330px; margin-left: auto; padding: 2rem; border: 1px solid rgba(201,166,107,.48); background: linear-gradient(145deg, #263630, #1d2925 72%); box-shadow: 22px 22px 0 rgba(0,0,0,.16); transform: rotate(2deg); }
.hero-file:before { content: "CONFIDENTIAL"; position: absolute; right: 1.4rem; top: 1.35rem; border: 2px solid var(--accent); color: #df8d72; padding: .23rem .48rem; font-size: .62rem; font-weight: 850; letter-spacing: .16em; transform: rotate(8deg); }
.file-tab { display: inline-block; margin: -2rem 0 1.6rem -2rem; padding: .35rem .8rem; background: var(--brass); color: var(--ink); font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero-file h2 { max-width: 275px; margin: 0 0 1rem; font: 500 2.2rem/1.05 var(--serif); }
.hero-file p { color: #c8d0c8; font-size: .88rem; }
.file-rule { height: 1px; margin: 1.3rem 0; background: rgba(255,255,255,.15); }
.file-meta { display: flex; justify-content: space-between; color: var(--brass); font-size: .68rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.file-lines { display: grid; gap: .65rem; margin-top: 1.35rem; }
.file-lines span { height: 5px; background: rgba(255,255,255,.13); }
.file-lines span:nth-child(2) { width: 82%; }
.file-lines span:nth-child(3) { width: 65%; }

/* Case cards / archive */
.cases-section { background: var(--paper); }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.case-card { display: flex; flex-direction: column; min-height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 4px 16px rgba(23,34,31,.035); transition: transform .2s ease, box-shadow .2s ease; }
.case-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.case-art { position: relative; display: flex; min-height: 170px; align-items: end; padding: 1.35rem; background: var(--ink-soft); color: white; overflow: hidden; }
.case-art .case-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-art:has(.case-cover):before { z-index: 1; border-color: rgba(255,255,255,.2); }
.case-art:has(.case-cover):after { z-index: 1; border-color: rgba(255,255,255,.15); }
.case-art .case-art-label, .case-art .case-number { z-index: 2; }
.case-art:before, .case-art:after { content: ""; position: absolute; border: 1px solid rgba(201,166,107,.3); border-radius: 50%; }
.case-art:before { width: 260px; height: 260px; right: -58px; top: -148px; }
.case-art:after { width: 160px; height: 160px; right: -8px; top: -98px; }
.case-art-label { position: relative; z-index: 1; color: var(--brass); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.case-number { position: absolute; right: 1.3rem; bottom: .95rem; color: rgba(255,255,255,.15); font: 700 3.8rem/.9 var(--serif); }
.case-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.35rem; }
.case-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .8rem; }
.case-tag { display: inline-block; border: 1px solid var(--line); border-radius: 2px; padding: .2rem .45rem; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.case-tag.difficulty { border-color: #ddc49c; color: #825c2a; background: #fbf4e8; }
.case-card h3 { margin: 0 0 .5rem; font: 500 1.55rem/1.12 var(--serif); }
.case-card p { margin: 0 0 1.2rem; color: var(--muted); font-size: .92rem; }
.case-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid #eee9df; }
.case-price { font-size: .95rem; font-weight: 800; }
.case-open { color: var(--accent-dark); font-size: .84rem; font-weight: 800; text-decoration: none; }
.case-empty { padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.case-empty h3 { margin: 0 0 .4rem; color: var(--ink); font: 500 1.55rem var(--serif); }

/* Flow / return loop */
.how-section { background: var(--paper-deep); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { position: relative; padding: 1.5rem 1.5rem 1.55rem; border-top: 1px solid #b9ad99; }
.step-number { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 1.25rem; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-dark); font: 700 1rem var(--serif); }
.step h3 { margin: 0 0 .5rem; font: 500 1.6rem var(--serif); }
.step p { margin: 0; color: #58645d; }
.return-band { padding: 3.4rem 0; background: var(--accent); color: white; }
.return-band-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.return-band h2 { margin: 0 0 .4rem; font: 500 clamp(1.8rem, 4vw, 2.8rem)/1.05 var(--serif); }
.return-band p { margin: 0; color: rgba(255,255,255,.82); }
.return-band .button { flex: 0 0 auto; background: var(--white); color: var(--ink); }

/* Content, WooCommerce and account */
.content-wrap { padding: 3.5rem 0 5rem; }
.page-header { margin-bottom: 2rem; padding-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.page-title { margin: .4rem 0 0; font: 500 clamp(2.4rem, 5vw, 4rem)/1.05 var(--serif); letter-spacing: -.035em; }
.entry-content { max-width: 820px; }
.woocommerce .woocommerce-breadcrumb { color: var(--muted); font-size: .82rem; }
.woocommerce .col-full { width: auto; max-width: none; margin: 0; padding: 0; }
.woocommerce .woocommerce-breadcrumb a { color: var(--muted); }
.woocommerce .woocommerce-result-count, .woocommerce .woocommerce-ordering { color: var(--muted); font-size: .88rem; }
.woocommerce ul.products { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; margin: 1.5rem 0 2rem; }
.woocommerce ul.products:before, .woocommerce ul.products:after { display: none; }
.woocommerce ul.products li.product { float: none; width: auto; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 0 0 1rem; }
.woocommerce ul.products li.product a img { width: 100%; height: 185px; object-fit: cover; margin: 0 0 1rem; background: var(--ink-soft); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { padding: 0 1rem; font: 500 1.42rem/1.1 var(--serif); }
.woocommerce ul.products li.product .price { padding: 0 1rem; color: var(--ink); font-weight: 800; }
.woocommerce ul.products li.product a.button { margin: .5rem 1rem 0; }
.woocommerce div.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 3rem; align-items: start; }
.woocommerce div.product .woocommerce-product-gallery { width: 100% !important; float: none !important; }
.woocommerce div.product .summary { width: 100% !important; float: none !important; }
.woocommerce div.product .product_title { font: 500 clamp(2.3rem, 5vw, 4rem)/1.02 var(--serif); letter-spacing: -.03em; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--ink); font-weight: 800; }
.woocommerce div.product .woocommerce-tabs { grid-column: 1/-1; }
.woocommerce div.product .woocommerce-tabs ul.tabs { padding-left: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { border-color: var(--line); background: #eee8dc; }
.scf-product-meta { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 1.4rem; }
.scf-product-meta span { border: 1px solid var(--line); background: var(--white); padding: .38rem .62rem; color: var(--muted); font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--success); background: #f2f7f2; }
.woocommerce-message:before, .woocommerce-info:before { color: var(--success); }
.woocommerce-error { border-top-color: var(--accent); }
.woocommerce table.shop_table { border-color: var(--line); border-radius: 5px; background: var(--white); }
.woocommerce table.shop_table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.woocommerce form .form-row label { color: var(--ink-soft); font-size: .86rem; font-weight: 700; }
.woocommerce form .form-row .input-text, .woocommerce form .form-row select { width: 100%; }
.woocommerce-MyAccount-navigation ul { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.woocommerce-MyAccount-navigation a { display: block; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--ink); font-weight: 700; text-decoration: none; }
.woocommerce-MyAccount-navigation .is-active a { border-color: var(--ink); background: var(--ink); color: white; }
.woocommerce-account .woocommerce-MyAccount-content { min-height: 190px; }
.woocommerce .quantity .qty { min-height: 44px; }
.woocommerce span.onsale { top: 12px; left: 12px; min-height: auto; min-width: auto; border-radius: 2px; padding: .4rem .55rem; background: var(--accent); line-height: 1; }
.woocommerce nav.woocommerce-pagination ul { border: 0; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 .2rem; border: 1px solid var(--line); border-radius: 50%; background: var(--white); }

/* Footer */
.site-footer { padding: 2.2rem 0; background: var(--ink); color: #c5ccc5; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer-brand { color: white; font: 600 1.1rem var(--serif); }
.footer-copy { margin: .3rem 0 0; color: #9ca79e; font-size: .8rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-nav a { color: #c5ccc5; font-size: .84rem; text-decoration: none; }

@media (max-width: 900px) {
  .hero-grid { gap: 2rem; }
  .hero-file { min-height: 300px; }
  .case-grid, .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .woocommerce div.product { gap: 1.7rem; }
}
@media (max-width: 700px) {
  .container { width: min(100% - 32px, 560px); }
  .header-inner { min-height: 68px; }
  .menu-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; align-items: stretch; gap: 0; padding: .5rem 1rem 1rem; background: var(--ink); border-top: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 18px rgba(0,0,0,.16); }
  .site-nav.is-open { display: flex; flex-direction: column; }
  .site-nav a { padding: .8rem .3rem; border-bottom: 1px solid rgba(255,255,255,.1); }
  .site-nav .nav-account { border: 0; padding: .8rem .3rem; }
  .hero { padding: 4.2rem 0 4.6rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero h1 { font-size: clamp(3rem, 14vw, 4.5rem); }
  .hero-copy { font-size: 1rem; }
  .hero-file { width: calc(100% - 10px); min-height: 280px; margin: 0 0 0 5px; padding: 1.5rem; }
  .file-tab { margin: -1.5rem 0 1.35rem -1.5rem; }
  .section { padding: 3.5rem 0; }
  .section-heading { display: block; }
  .section-heading p { margin-top: .8rem; }
  .case-grid, .steps { grid-template-columns: 1fr; }
  .case-art { min-height: 145px; }
  .steps { gap: .6rem; }
  .step { padding: 1.2rem 0 1.35rem; }
  .return-band-inner { align-items: flex-start; flex-direction: column; }
  .content-wrap { padding: 2.4rem 0 3.5rem; }
  .woocommerce ul.products { grid-template-columns: 1fr; gap: .9rem; }
  .woocommerce div.product { display: block; }
  .woocommerce div.product .summary { margin-top: 1.5rem; }
  .woocommerce .woocommerce-result-count, .woocommerce .woocommerce-ordering { float: none; }
  .woocommerce .woocommerce-ordering { margin-top: .6rem; }
  .woocommerce table.shop_table { font-size: .86rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
