/* =========================================================
   Peggy's Vintage Halloween Art — main stylesheet
   ========================================================= */

:root {
  --color-bg: #0d0805;
  --color-bg-panel: #150e09;
  --color-border: #c1622c;
  --color-border-soft: #6b3a1f;
  --color-accent: #e0631f;
  --color-accent-bright: #f2803c;
  --color-cream: #f3ead9;
  --color-text: #e9ddc8;
  --color-text-muted: #b8a98d;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, serif;

  --radius: 6px;
  --max-width: 1280px;
  --gap: 1.5rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--color-accent-bright);
  outline-offset: 2px;
}

/* Base font size: set directly on body above (19px) rather than via
   root scaling, since body previously had a fixed px value that
   ignored root-level font-size changes. */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.8rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--color-accent-bright), var(--color-accent));
  color: #1a0c04;
  border-color: var(--color-accent-bright);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-outline {
  background: transparent;
  color: var(--color-accent-bright);
  font-size: .78rem;
  padding: .55rem 1.3rem;
}
.btn-outline:hover { background: rgba(224,99,31,.12); }

/* ---------- Page-wide outer frame ---------- */
.page-frame {
  margin: 1rem;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
}

/* ---------- Announcement bar ---------- */
.announcement-bar-outer {
  padding: 1rem 1.5rem 0;
}
.announcement-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  background: linear-gradient(90deg, #7a3410, #b6541e, #7a3410);
  color: #1a0c04;
  text-align: center;
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .05em;
  padding: .5rem 1rem;
  border-radius: var(--radius);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--color-bg);
  padding: 1.5rem 1.5rem 0;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
}

.brand-logo { width: 210px; height: auto; display: block; }

.main-nav { flex: 1; display: flex; justify-content: center; }
.nav-list {
  list-style: none;
  display: flex;
  gap: 2.2rem;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: .95rem;
  letter-spacing: .04em;
}
.nav-item { position: relative; }
.nav-item a { display: flex; align-items: center; gap: .3rem; padding: .5rem 0; }
.nav-item a.is-active,
.nav-item a:hover { color: var(--color-accent-bright); }

.has-dropdown .dropdown {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  list-style: none;
  margin: 0;
  padding: .5rem 0;
  min-width: 170px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
  z-index: 20;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
}
.dropdown a { padding: .5rem 1.2rem; font-size: .85rem; }
.dropdown a:hover { background: rgba(224,99,31,.12); }

.header-actions { display: flex; align-items: center; gap: 1.3rem; }
.icon-link { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.icon-link:hover { color: var(--color-accent-bright); }
.cart-count {
  background: var(--color-accent);
  color: #1a0c04;
  border-radius: 50%;
  width: 1.1em; height: 1.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--color-cream); }

/* ---------- Hero ---------- */
.hero { padding: 1.5rem; }
.hero-frame {
  max-width: var(--max-width);
  margin: 0 auto;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 2rem;
  padding: 3rem;
  position: relative;
}
.hero-frame::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--color-border-soft);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

/* Reusable ornamental corner scrolls — apply .ornate-frame to any bordered,
   position:relative box to get matching corner flourishes on all four corners.
   No extra markup needed beyond the class itself. */
.ornate-frame {
  position: relative;
}
.corner-scroll {
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 1;
}
.corner-scroll svg { width: 100%; height: 100%; display: block; }
.corner-scroll-tl { top: -1px; left: -1px; }
.corner-scroll-tr { top: -1px; right: -1px; transform: scaleX(-1); }
.corner-scroll-bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.corner-scroll-br { bottom: -1px; right: -1px; transform: scale(-1, -1); }
@media (max-width: 640px) {
  .corner-scroll { width: 32px; height: 32px; }
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--color-cream);
  line-height: 1.15;
  margin: 0 0 1rem;
}
.hero-copy .accent { color: var(--color-accent-bright); }
.divider { color: var(--color-accent); margin-bottom: 1.2rem; }
.hero-copy p {
  color: var(--color-text-muted);
  max-width: 34ch;
  margin-bottom: 1.8rem;
}
.hero-media img {
  border-radius: var(--radius);
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ---------- Shop collection ---------- */
.collection { padding: 2rem 1.5rem 3rem; max-width: var(--max-width); margin: 0 auto; }
.section-title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.8rem;
  margin-bottom: 2rem;
}
.section-title .rule { width: 60px; height: 1px; background: var(--color-border-soft); }

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
.category-card {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
}
.category-media {
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  margin-bottom: 1rem;
  aspect-ratio: 1 / 1;
}
.category-media img { width: 100%; height: 100%; object-fit: cover; }
.category-card h3 {
  font-family: var(--font-display);
  color: var(--color-cream);
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

/* ---------- Features ---------- */
.features {
  max-width: var(--max-width);
  margin: 0 auto 3rem;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: 2.2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.feature {
  text-align: center;
  padding: 0 1.5rem;
}
.feature.has-divider { border-right: 1px solid var(--color-border-soft); }
.feature-icon { color: var(--color-accent); margin-bottom: .8rem; }
.feature h3 {
  font-family: var(--font-display);
  color: var(--color-cream);
  font-size: 1.05rem;
  margin: 0 0 .5rem;
}
.feature p {
  color: var(--color-text-muted);
  font-size: .92rem;
  margin: 0;
}

/* ---------- Generic page section (used by template.php) ---------- */
.page-section { padding: 3rem 1.5rem; }
.page-section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.page-section-inner h1 {
  font-family: var(--font-display);
  color: var(--color-cream);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0 0 1rem;
}
.page-section-inner p { color: var(--color-text-muted); }

/* Utility: bordered vintage box. Combine with .ornate-frame for corner
   scrolls, e.g. <div class="boxed ornate-frame"> ... </div> */
.boxed {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: 2rem;
}

/* ---------- Contact page ---------- */
.contact-box { max-width: 620px; margin: 0 auto; }
.contact-form { margin-top: 1.5rem; }
.form-row { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.form-row label {
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .04em;
  color: var(--color-cream);
}
.form-row input,
.form-row textarea {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border-soft);
  border-radius: 3px;
  padding: .7rem 1rem;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border-soft);
  padding: 2.5rem 1.5rem 1.5rem;
}
.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-media img { border-radius: var(--radius); }
.footer-newsletter h3 {
  font-family: var(--font-display);
  color: var(--color-accent-bright);
  margin: 0 0 .5rem;
}
.footer-newsletter p { color: var(--color-text-muted); margin: 0 0 1rem; max-width: 40ch; }
.newsletter-form {
  display: flex;
  gap: .6rem;
  margin-bottom: 1.2rem;
}
.newsletter-form input {
  flex: 1;
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border-soft);
  border-radius: 3px;
  padding: 1rem 1.2rem;
  font-size: 1.05rem;
  color: var(--color-text);
  font-family: var(--font-body);
  min-width: 0;
}
.newsletter-form input::placeholder { color: var(--color-text-muted); }

/* Honeypot spam-trap field: invisible to real visitors, but present in
   the markup so spam bots (which fill every field) reveal themselves. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.social-links { display: flex; gap: .8rem; }
.social-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--color-border-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-accent-bright);
}
.social-icon:hover { background: rgba(224,99,31,.12); }

.footer-credit {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: 1.2rem;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  text-align: center;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
}
.rule-mark { color: var(--color-border-soft); }

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* Tablet */
@media (max-width: 900px) {
  .hero-frame {
    grid-template-columns: 1fr;
    padding: 2rem;
    text-align: center;
  }
  .hero-copy p { margin-left: auto; margin-right: auto; }
  .hero-media { order: -1; }

  .collection-grid { grid-template-columns: repeat(2, 1fr); }

  .features { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
  .feature.has-divider:nth-child(2n) { border-right: none; }
  .feature:nth-child(-n+2) { border-bottom: 1px solid var(--color-border-soft); padding-bottom: 1.5rem; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-media { max-width: 320px; margin: 0 auto; }
}

/* Mobile */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .nav-toggle { display: flex; }

  .main-nav { order: 3; width: 100%; }
  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border-soft);
    margin-top: .75rem;
  }
  .nav-list.is-open { display: flex; }
  .nav-item a { padding: .8rem 0; }
  .has-dropdown .dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    border: none;
    background: transparent;
    padding-left: 1rem;
  }
  .has-dropdown.is-expanded .dropdown { display: block; }

  .hero { padding: 1rem; }
  .hero-frame { padding: 1.5rem; }
  .hero-copy h1 { font-size: 1.9rem; }

  .collection-grid { grid-template-columns: 1fr; }

  .features { grid-template-columns: 1fr; padding: 1.5rem; }
  .feature { border: none !important; padding-bottom: 1.5rem; border-bottom: 1px solid var(--color-border-soft) !important; }
  .feature:last-child { border-bottom: none !important; padding-bottom: 0; }

  .newsletter-form { flex-direction: column; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .has-dropdown .dropdown { transition: none; }
}
/* --- Shop product grid (add to style.css) --- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.product-card {
    border: 1px solid var(--color-accent, #e0631f);
    border-radius: 6px;
    padding: 18px;
    text-align: center;
    background: rgba(224, 99, 31, 0.04);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Gallery category cards (add to style.css) --- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.category-card {
    text-align: center;
    padding: 24px 18px;
}

.category-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-title {
    text-align: center;
    margin: 40px 0 8px;
}

/* Small button variant, used on category cards */
.btn.small {
    font-size: 0.85rem;
    padding: 6px 14px;
}
/* --- Artwork detail page (add to style.css) --- */

.artwork-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 700px) {
    .artwork-detail {
        grid-template-columns: 1fr;
    }
}

.artwork-detail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.artwork-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artwork-detail-info .price {
    font-size: 1.4rem;
    color: var(--color-accent, #e0631f);
    font-weight: 600;
    margin: 10px 0;
}
/* --- Cart page (add to style.css) --- */

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.cart-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid rgba(224, 99, 31, 0.25);
    padding-bottom: 16px;
}

.cart-row-image {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.cart-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-row-info h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.cart-total {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-accent, #e0631f);
    margin: 16px 0;
}

.cart-totals {
    margin: 20px 0;
    padding-top: 16px;
    border-top: 1px dashed rgba(224, 99, 31, 0.3);
}

.cart-totals p {
    margin: 6px 0;
}
/* --- Shared image lightbox (add to style.css) --- */

.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-modal.is-open {
    display: flex;
}

.lightbox-modal img {
    max-width: 90vw;
    max-height: 90vh;
    border: 2px solid var(--color-accent, #e0631f);
    border-radius: 6px;
    object-fit: contain;
}

.lightbox-trigger {
    cursor: zoom-in;
}

/* --- Site-wide announcement modal (Peggy-controlled via admin) --- */

.site-announcement-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.site-announcement-overlay.is-open {
    display: flex;
}

.site-announcement-box {
    position: relative;
    background: #000000;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-width: 750px;
    width: 100%;
    padding: 48px 56px;
    box-sizing: border-box;
    color: #ffffff;
    font-family: var(--font-body);
    max-height: 85vh;
    overflow-y: auto;
}

.site-announcement-content h2,
.site-announcement-content h3 {
    font-family: var(--font-display);
    color: var(--color-cream);
    margin-top: 0;
}

.site-announcement-content a {
    color: var(--color-accent-bright);
}

#site-announcement-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

#site-announcement-close:hover {
    color: var(--color-accent-bright);
}
/* --- Artwork detail page (add to style.css) --- */

.artwork-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 700px) {
    .artwork-detail {
        grid-template-columns: 1fr;
    }
}

.artwork-detail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.artwork-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artwork-detail-info .price {
    font-size: 1.4rem;
    color: var(--color-accent, #e0631f);
    font-weight: 600;
    margin: 10px 0;
}
/* --- Hero buttons row (add to style.css) --- */
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.hero-buttons .btn {
    width: auto;
}

