/* =====================================================
   Mecemag — public site styles
   Palette: quiet luxury — ivory, graphite, antique gold
   ===================================================== */
:root {
  --bg: #f8f6f1;          /* warm ivory */
  --panel: #ffffff;
  --panel-2: #efece4;     /* alt sections */
  --ink: #212225;         /* graphite, near-black */
  --dark: #17181b;        /* header, hero, footer */
  --muted: #6f6c66;
  --line: #e0dcd2;
  --gold: #a5813f;        /* antique gold, used sparingly */
  --gold-dark: #866729;
  --wood: #8b6f4e;
  --wood-dark: #6b5238;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3, .brand { font-family: var(--serif); line-height: 1.2; font-weight: 400; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.7rem; }
a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--gold); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.lead { font-size: 1.15rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--gold-dark); margin-bottom: .5rem; }

/* ---------- header ---------- */
.site-header {
  background: #0e0f11; color: #f3f1ea; border-bottom: 1px solid rgba(243,241,234,.08);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; flex-wrap: wrap; gap: .75rem; }
.brand { font-size: 1.6rem; color: #f3f1ea; letter-spacing: .08em; }
.brand:hover { text-decoration: none; color: #fff; }
.main-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.main-nav a { color: #f3f1ea; font-size: .92rem; letter-spacing: .04em; opacity: .85; }
.main-nav a:hover { opacity: 1; color: #fff; text-decoration: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: .65rem 1.3rem; border: 1px solid var(--ink);
  border-radius: 2px; background: transparent; color: var(--ink);
  font-size: .92rem; letter-spacing: .03em; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; background: var(--ink); color: #f3f1ea; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #f3f1ea; }
.btn-primary:hover { background: #000; border-color: #000; color: #fff; }
.btn-ghost { background: transparent; border-color: currentColor; }
.btn-ghost:hover { background: transparent; color: var(--gold-dark); }
.btn-small { padding: .35rem .8rem; font-size: .85rem; }
.btn-block { display: block; width: 100%; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }
.main-nav .btn-small { border-color: #f3f1ea; color: #f3f1ea; }
.main-nav .btn-small:hover { background: #f3f1ea; color: var(--dark); }

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, #1e2025 0%, var(--dark) 70%); color: #f3f1ea; padding: 3.5rem 0 4rem; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; }
.hero .lead { opacity: .8; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; }
.hero .btn { border-color: #f3f1ea; color: #f3f1ea; }
.hero .btn:hover { background: #f3f1ea; color: var(--dark); }
.hero .btn-primary { background: #f3f1ea; border-color: #f3f1ea; color: var(--dark); }
.hero .btn-primary:hover { background: #fff; border-color: #fff; }
.hero-cover { position: relative; display: block; max-width: 300px; justify-self: end;
  transform: rotate(2deg); transition: transform .2s; }
.hero-cover:hover { transform: rotate(0deg) scale(1.02); }
.hero-cover img, .hero-cover .cover-placeholder { width: 100%; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.hero-cover-badge {
  position: absolute; top: -12px; right: -12px; background: var(--gold); color: #fff;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; padding: .35rem .7rem; border-radius: 2px;
}

/* ---------- covers ---------- */
.cover-placeholder {
  aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.1rem; background: linear-gradient(160deg, #212225 0%, #3a3c41 100%);
  color: #f3f1ea; border: 1px solid rgba(165,129,63,.4);
}
.cover-issue { font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: var(--gold); }
.cover-title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; }
.cover-month { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; opacity: .7; }

/* ---------- magazine rack ---------- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--panel-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.75rem; flex-wrap: wrap; gap: .5rem; }
.page-head { margin-bottom: 2.25rem; }

.rack { margin-bottom: 2.5rem; }
.rack-shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.75rem; align-items: end; padding: 0 1.5rem 0;
}
.rack-item { display: block; text-align: center; color: var(--ink); }
.rack-item:hover { text-decoration: none; }
.rack-item img, .rack-item .cover-placeholder {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block;
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
  transform-origin: bottom center; transition: transform .18s ease;
  border: 1px solid rgba(0,0,0,.12); background: #fff;
}
.rack-item:hover img, .rack-item:hover .cover-placeholder { transform: translateY(-8px) rotate(-1deg); }
.rack-label { display: block; margin-top: .85rem; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.rack-bar {
  height: 16px; margin-top: -6px; border-radius: 3px;
  background: linear-gradient(180deg, var(--wood) 0%, var(--wood-dark) 100%);
  box-shadow: 0 6px 12px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.25);
}
.rack-actions { display: flex; gap: .4rem; justify-content: center; margin-top: .5rem; flex-wrap: wrap; }

/* ---------- plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.plan-card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 2px;
  padding: 1.75rem; display: flex; flex-direction: column; gap: .6rem;
}
.plan-card .btn { margin-top: auto; }
.plan-featured { border-color: var(--gold); box-shadow: 0 6px 18px rgba(165,129,63,.14); }
.plan-flag {
  position: absolute; top: -11px; left: 1.25rem; background: var(--gold); color: #fff;
  font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; padding: .2rem .6rem; border-radius: 2px;
}
.plan-price { font-family: var(--serif); font-size: 2rem; }
.plan-price span { font-size: .95rem; color: var(--muted); font-family: var(--sans); }

/* ---------- edition detail ---------- */
.edition-detail { display: grid; grid-template-columns: 300px 1fr; gap: 3rem; align-items: start; }
.big-cover img, .big-cover .cover-placeholder { width: 100%; box-shadow: 0 14px 30px rgba(0,0,0,.25); }
.edition-desc { margin: 1rem 0 1.5rem; }
.access-box { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 1.4rem; }
.access-owned { color: #3d6b4a; font-weight: 600; }

.article-list { display: flex; flex-direction: column; }
.article-row { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.article-row h3 { margin-bottom: .3rem; }
.byline { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.free-tag { color: #3d6b4a; font-weight: 600; }
.lock { font-size: .85rem; }

/* ---------- article page ---------- */
.article-body { max-width: 720px; }
.article-body h1 { margin: .25rem 0 .5rem; }
.prose { margin-top: 1.5rem; font-size: 1.08rem; }
.prose p { margin-bottom: 1.1rem; }
.prose img { max-width: 100%; height: auto; }
.paywall {
  margin-top: 2rem; padding: 2rem; text-align: center; border-radius: 2px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.paywall .btn-row { justify-content: center; }

/* ---------- forms & cards ---------- */
.form-narrow { max-width: 480px; margin: 0 auto; }
.form-narrow h1 { margin-bottom: .5rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 1.5rem; margin: 1.25rem 0; }
.form label { display: block; margin-bottom: 1rem; font-size: .9rem; font-weight: 600; }
.form input, .form select, .form textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem;
  border: 1px solid #cdc7ba; border-radius: 2px; font-size: 1rem; font-family: inherit;
  background: #fff; color: var(--ink); font-weight: 400;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkout-summary h3 { margin-bottom: .3rem; }
.checkout-edition { display: flex; gap: 1.25rem; align-items: flex-start; }
.mini-cover { width: 100px; flex-shrink: 0; }
.mini-cover img, .mini-cover .cover-placeholder { width: 100%; box-shadow: 0 6px 14px rgba(0,0,0,.22); }
.mini-cover .cover-placeholder { padding: .6rem; }
.mini-cover .cover-title { font-size: .8rem; }

/* ---------- flash + status ---------- */
.flash { padding: .85rem 1.1rem; border-radius: 2px; margin: 1rem 0; font-size: .95rem; }
.flash-success { background: #eaf1ea; color: #3d6b4a; border: 1px solid #c6dbc8; }
.flash-error   { background: #f7e9e6; color: #8c4136; border: 1px solid #e6c8c0; }
.flash-info    { background: #eaeef3; color: #3c5570; border: 1px solid #ccd8e4; }

.status { display: inline-block; padding: .15rem .6rem; border-radius: 2px; font-size: .76rem; font-weight: 600; letter-spacing: .03em; }
.status-pending    { background: #f5edda; color: #7d6229; }
.status-processing { background: #eaeef3; color: #3c5570; }
.status-shipped    { background: #e7edf6; color: #2d5183; }
.status-delivered,
.status-paid,
.status-published  { background: #eaf1ea; color: #3d6b4a; }
.status-cancelled,
.status-refunded,
.status-failed     { background: #f7e9e6; color: #8c4136; }
.status-draft      { background: #edeae2; color: #6f6c66; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); font-size: .92rem; }
.data-table th, .data-table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { background: var(--panel-2); text-transform: uppercase; font-size: .7rem; letter-spacing: .1em; color: var(--muted); }

/* ---------- account ---------- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: #f3f1ea; margin-top: 3rem; padding: 2.5rem 0 1.5rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 1.5rem; }
.brand-small { font-family: var(--serif); font-size: 1.3rem; letter-spacing: .06em; }
.footer-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.footer-nav a { color: #f3f1ea; opacity: .8; font-size: .9rem; }
.copyright { border-top: 1px solid rgba(243,241,234,.18); padding-top: 1.25rem; font-size: .82rem; opacity: .55; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-cover { justify-self: start; }
  .edition-detail { grid-template-columns: 1fr; }
  .big-cover { max-width: 280px; }
  .field-row { grid-template-columns: 1fr; }
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 2.2rem; }
}
