/*
Theme Name: Barry Stedman
Theme URI: https://example.com
Author: Custom
Author URI: https://example.com
Description: A minimal, elegant portfolio theme for artists and ceramicists. Inspired by clean gallery aesthetics with masonry grid, subtle typography, and refined whitespace.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: barry-stedman
Tags: portfolio, art, minimal, masonry, gallery
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --color-bg:         #38383b;
  --color-bg-alt:     #f2efe9;
  --color-text:       #1a1a18;
  --color-text-muted: #7a7772;
  --color-border:     #e0dbd3;
  --color-accent:     #8b5e3c;
  --color-white:      #ffffff;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', 'Helvetica Neue', Helvetica, sans-serif;

  --nav-height: 70px;
  --max-width:  1400px;
  --gap:        16px;

  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.7;
}

img { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }

p { margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   SITE HEADER & NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background-color: var(--color-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background-color var(--transition);
}

.site-header.scrolled {
  border-bottom-color: var(--color-border);
  background-color: rgba(249, 247, 244, 0.96);
  backdrop-filter: blur(8px);
}

.header-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Site branding */
.site-branding .site-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.site-branding .site-title a:hover { opacity: 0.65; }

/* Primary Nav */
.primary-navigation ul {
  display: flex;
  align-items: center;
  gap: 36px;
}

.primary-navigation a {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: color var(--transition);
  position: relative;
}

.primary-navigation a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width var(--transition);
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item a {
  color: var(--color-text);
}

.primary-navigation a:hover::after,
.primary-navigation .current-menu-item a::after {
  width: 100%;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--color-text);
  transition: var(--transition);
}

/* ============================================================
   MAIN CONTENT OFFSET
   ============================================================ */
#page { padding-top: var(--nav-height); }

/* ============================================================
   MASONRY GALLERY (Homepage)
   ============================================================ */
.gallery-grid {
  columns: 3;
  column-gap: var(--gap);
  padding: 32px 40px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--gap);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
  opacity: 0;
}

.gallery-item img.loaded { opacity: 1; }

.gallery-item:hover img { transform: scale(1.025); }

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(249, 247, 244, 0.97);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active { display: flex; }

.lightbox-inner {
  position: relative;
  max-width: 85vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-inner img {
  max-width: 85vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0,0,0,0.12);
}

.lightbox-close {
  position: fixed;
  top: 28px;
  right: 36px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
  line-height: 1;
  z-index: 1000;
}

.lightbox-close:hover { color: var(--color-text); }

.lightbox-caption {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   PAGE HERO (interior pages)
   ============================================================ */
.page-hero {
  padding: 64px 40px 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 60px;
}

.page-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.01em;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px 80px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 80px;
  align-items: start;
}

.about-image img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.about-text p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text);
}

.about-text p + p { margin-top: 1.25em; }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-layout {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 40px 100px;
}

.contact-form .form-group {
  margin-bottom: 28px;
}

.contact-form label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding: 10px 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
  resize: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-bottom-color: var(--color-text);
}

.contact-form textarea { min-height: 140px; }

.btn-submit {
  display: inline-block;
  margin-top: 12px;
  padding: 13px 40px;
  background: var(--color-text);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

.btn-submit:hover { opacity: 0.75; }

/* ============================================================
   STOCKISTS PAGE
   ============================================================ */
.stockists-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 100px;
}

.stockist-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}

.stockist-item:first-child { border-top: 1px solid var(--color-border); }

.stockist-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.stockist-location {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
}

.stockist-link {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.stockist-link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* ============================================================
   EVENTS PAGE
   ============================================================ */
.events-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px 100px;
}

.event-item {
  padding: 36px 0;
  border-bottom: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 40px;
  align-items: start;
}

.event-item:first-child { border-top: 1px solid var(--color-border); }

.event-date {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  text-align: center;
}

.event-date .day {
  display: block;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-text);
}

.event-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.event-venue {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.event-description {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-copy {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.footer-social a:hover { color: var(--color-text); }

/* ============================================================
   STANDARD PAGE CONTENT
   ============================================================ */
.entry-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .gallery-grid { columns: 2; }
}

@media (max-width: 860px) {
  .about-layout { grid-template-columns: 1fr; gap: 40px; }
  .event-item { grid-template-columns: 80px 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  :root { --nav-height: 60px; }

  .header-inner { padding: 0 20px; }

  .primary-navigation {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    background: var(--color-bg);
    padding: 48px 24px;
    z-index: 99;
  }

  .primary-navigation.open { display: flex; flex-direction: column; }

  .primary-navigation ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .primary-navigation a {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    font-family: var(--font-display);
    text-transform: none;
    color: var(--color-text);
  }

  .menu-toggle { display: flex; }

  .gallery-grid { columns: 2; padding: 16px 16px; column-gap: 10px; }
  .gallery-item { margin-bottom: 10px; }

  .page-hero, .about-layout, .contact-layout,
  .stockists-layout, .events-layout, .entry-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-footer { flex-direction: column; gap: 16px; text-align: center; padding: 28px 20px; }

  .event-item { grid-template-columns: 1fr; gap: 8px; }
  .event-date { display: flex; gap: 10px; align-items: baseline; text-align: left; }
  .event-date .day { font-size: 1.5rem; }
}

@media (max-width: 380px) {
  .gallery-grid { columns: 1; }
}

/* ============================================================
   ANIMATIONS & FADE-IN
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   WP BLOCK / GUTENBERG OVERRIDES
   ============================================================ */
.wp-block-image img { max-width: 100%; }
.aligncenter { text-align: center; }
.alignleft  { float: left; margin-right: 24px; }
.alignright { float: right; margin-left: 24px; }
