/* =============================================================
   BARRY'S PHARMACY — SHARED STYLES
   Used by: index.html, common-conditions-service.html
   ============================================================= */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --canvas:       #f8f6f2;
  --paper:        #ffffff;
  --ink:          #1a2630;
  --text:         #3d4f5c;
  --subtle:       #6b7d8a;
  --hairline:     #e2ddd6;
  --wash:         #f0ede7;
  --green:        #1e5c3a;
  --green-mid:    #256b44;
  --green-dark:   #143d27;
  --green-pale:   #e6f2eb;
  --green-accent: #2e7d52;
  --navy:         #1a2630;
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --shadow-sm:    0 2px 8px rgba(26,38,48,0.08);
  --shadow:       0 8px 32px rgba(26,38,48,0.12);
  --shadow-lg:    0 24px 72px rgba(26,38,48,0.16);
  --max:          1200px;
  --display:      "Playfair Display", Georgia, serif;
  --body:         "Inter", ui-sans-serif, system-ui, -apple-system,
                  BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--body);
  color-scheme: light;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 0.07em; text-underline-offset: 0.22em; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }

/* ── Accessibility ─────────────────────────────────────────── */
.skip-link {
  position: absolute; left: 1rem; top: 1rem; z-index: 200;
  transform: translateY(-150%); border-radius: 999px;
  background: var(--ink); color: white; padding: 0.75rem 1rem;
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

/* ── Layout ────────────────────────────────────────────────── */
.wrap { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}
.topbar .wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar strong { font-weight: 700; }
.topbar a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 600; white-space: nowrap;
  background: rgba(255,255,255,0.15);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s;
}
.topbar a:hover { background: rgba(255,255,255,0.25); }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid rgba(226,221,214,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand-logo { height: auto; max-width: calc(100vw - 80px); }
.brand-wordmark {
  font-family: var(--display);
  font-size: 1.35rem; font-weight: 700;
  color: var(--green); letter-spacing: -0.01em; line-height: 1;
}
.brand-wordmark span {
  display: block;
  font-size: 0.72rem; font-weight: 400;
  font-family: var(--body); color: var(--subtle);
  letter-spacing: 0.04em; text-transform: uppercase; margin-top: 0.2rem;
}

/* ── Primary Nav ───────────────────────────────────────────── */
.nav-primary { display: flex; align-items: center; gap: 0.25rem; }
.nav-primary a:not(.btn) {
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.925rem; font-weight: 500;
  color: var(--text); text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-primary a:not(.btn):hover { background: var(--wash); color: var(--ink); }
.nav-primary a.active { background: var(--green-pale); color: var(--green-dark); font-weight: 600; }
.nav-primary .nav-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--hairline); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.7rem 1.4rem;
  border: 2px solid transparent; border-radius: 999px;
  font-family: var(--body); font-size: 0.925rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--green); color: white;
  box-shadow: 0 4px 16px rgba(30,92,58,0.3);
}
.btn-primary:hover {
  background: var(--green-dark);
  box-shadow: 0 6px 24px rgba(30,92,58,0.4);
  transform: translateY(-1px);
}
.btn-outline { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-outline:hover { background: var(--wash); border-color: #ccc8c0; }
.btn-white { background: white; color: var(--green); box-shadow: var(--shadow-sm); }
.btn-white:hover { background: var(--green-pale); transform: translateY(-1px); }
.btn-ghost-white { background: transparent; color: white; border-color: rgba(255,255,255,0.4); }
.btn-ghost-white:hover { background: rgba(255,255,255,0.12); }
.btn-sm { min-height: 40px; padding: 0.55rem 1.1rem; font-size: 0.875rem; }
.btn-lg { min-height: 54px; padding: 0.85rem 1.8rem; font-size: 1rem; }
.icon { width: 1.1em; height: 1.1em; flex: none; }

/* ── Mobile Menu ───────────────────────────────────────────── */
.hamburger {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  background: transparent; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 0;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: all 0.25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; position: fixed; inset: 0; top: 120px; z-index: 99;
  background: white; padding: 1.5rem;
  flex-direction: column; gap: 0.25rem;
  overflow-y: auto; box-shadow: var(--shadow-lg);
}
.mobile-nav.open { display: flex; }
.mobile-nav a:not(.btn) {
  display: block; padding: 1rem 0.75rem; border-radius: var(--radius);
  font-size: 1.05rem; font-weight: 500; text-decoration: none;
  color: var(--ink); border-bottom: 1px solid var(--hairline);
  transition: background 0.15s;
}
.mobile-nav a:not(.btn):hover { background: var(--wash); }
.mobile-nav .btn { margin-top: 1rem; width: 100%; justify-content: center; }

/* ── Section Utilities ─────────────────────────────────────── */
section { padding-block: clamp(4rem, 8vw, 6.5rem); }

.section-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--green);
}
.section-eyebrow::before {
  content: ""; display: block;
  width: 20px; height: 2px; background: var(--green); border-radius: 2px;
}
.section-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 0;
}
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-lead { color: var(--text); font-size: 1.05rem; line-height: 1.7; }

/* ── CCS Logo (appears on hero of both home and CCS page) ──── */
.ccs-hero-logo {
  position: absolute; top: 1.5rem; right: clamp(1rem, 3vw, 3rem);
  width: 160px; z-index: 2; opacity: 0.9;
}
@media (max-width: 600px) {
  .ccs-hero-logo { width: 100px; top: 1rem; }
}

/* ── Footer ────────────────────────────────────────────────── */
.footer { background: var(--navy); color: white; }
.footer-main {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) repeat(3, minmax(0,1fr));
  gap: 2rem 3rem;
  padding-block: 3.5rem 2.5rem;
}
.footer-brand .footer-name {
  font-family: var(--display);
  font-size: 1.45rem; font-weight: 700; color: white; margin-bottom: 0.3rem;
}
.footer-brand .footer-sub {
  font-size: 0.825rem; color: rgba(255,255,255,0.5); margin-bottom: 1.25rem;
}
.footer-brand p {
  font-size: 0.9rem; color: rgba(255,255,255,0.6);
  line-height: 1.65; max-width: 260px; margin-bottom: 0;
}
.social-links { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7); text-decoration: none;
  transition: all 0.18s;
}
.social-link:hover { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.35); }

.footer-col h4 {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { font-size: 0.9rem; color: rgba(255,255,255,0.68); text-decoration: none; transition: color 0.15s; }
.footer-col a:hover { color: white; }

.footer-bottom {
  padding-block: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.75rem;
}
.footer-bottom p { margin: 0; font-size: 0.85rem; color: rgba(255,255,255,0.4); }

.footer-psi {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.9rem 0.45rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.14); border-radius: 999px;
  font-size: 0.78rem; font-weight: 500;
  color: rgba(255,255,255,0.5); text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.footer-psi:hover {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
}
.footer-psi-flag { display: flex; gap: 1px; align-items: center; flex: none; }
.footer-psi-flag span { display: block; width: 5px; height: 12px; border-radius: 1px; }

/* ── Scroll Reveal ─────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-primary { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 640px) {
  .wrap { width: min(var(--max), calc(100% - 32px)); }
  .topbar-msg { display: none; }
  .footer-main { grid-template-columns: 1fr; }
  .brand-logo { max-width: 170px; }
}
