@layer reset, styles, prewind;

@import url("theme.css");
@import url("typography.css");
@import url("forms.css");
@import url("ui.css");
@import url("https://unpkg.com/prewindcss@1.3.1");

@layer styles {
  /* Shared proportions for the small, single-purpose owner screens. */
  .admin-access { max-width:29rem; margin:clamp(0rem,4vh,3rem) auto; padding:var(--space-lg); border:1px solid var(--light); border-radius:var(--rounded-lg); background:var(--white); box-shadow:0 8px 32px rgb(0 0 0 / .035); }
  .admin-access > h1 { letter-spacing:-.035em; }
  .admin-access > p { font-size:var(--text-base); }
  .admin-access > p:last-child { font-size:max(.875rem,var(--text-sm)); }
  .container { min-width:0; max-width:100%; }
  .admin-access form { margin-block:var(--space-lg); }
  .admin-access .form-field { margin-bottom:var(--space-md); font-size:var(--text-sm); }
  .admin-access input { font-size:max(1rem,var(--text-base)); }
  .admin-access .code-input { max-width:none; }
  .admin-access [role="alert"],.admin-access [role="status"] { padding:var(--space-sm); border:1px solid var(--light); border-radius:var(--rounded-lg); background:var(--lighter); }
  main > .container > h1 { max-width:20ch; }
  main > .container > h1:first-child { margin-top:0; }
  main > .container > p { max-width:58ch; }
  .desktop-navigation { display:flex; gap:var(--space-md); }
  .mobile-menu-toggle { display:none; align-items:center; justify-content:center; width:48px; height:48px; padding:8px; border:0; background:transparent; color:var(--black); }
  .mobile-menu-toggle:hover { background:transparent; }
  .mobile-menu-toggle span { display:block; width:30px; height:22px; background:linear-gradient(currentColor,currentColor) top/100% 2px no-repeat,linear-gradient(currentColor,currentColor) center/100% 2px no-repeat,linear-gradient(currentColor,currentColor) bottom/100% 2px no-repeat; }
  #mobile-navigation { margin:0 0 0 auto; inset:var(--flea-toolbar-height,0px) 0 0; width:min(22rem,100%); height:calc(100dvh - var(--flea-toolbar-height,0px)); overflow:auto; padding:var(--space-md); border:0; background:var(--white); color:var(--black); opacity:0; transform:translateX(24px); }
  #mobile-navigation:popover-open { opacity:1; transform:translateX(0); }
  #mobile-navigation::backdrop { inset:var(--flea-toolbar-height,0px) 0 0; background:#0005; opacity:0; }
  #mobile-navigation:popover-open::backdrop { opacity:1; }
  @media (prefers-reduced-motion:no-preference) {
    #mobile-navigation { transition:opacity 180ms ease,transform 180ms ease,display 180ms allow-discrete,overlay 180ms allow-discrete; }
    #mobile-navigation::backdrop { transition:opacity 180ms ease,display 180ms allow-discrete,overlay 180ms allow-discrete; }
    @starting-style {
      #mobile-navigation:popover-open { opacity:0; transform:translateX(24px); }
      #mobile-navigation:popover-open::backdrop { opacity:0; }
    }
  }
  #mobile-navigation nav { display:flex; flex-direction:column; gap:var(--space-md); }
  #mobile-navigation button[popovertargetaction="hide"] { position:relative; width:44px; height:44px; padding:0; border:0; background:transparent; color:inherit; font-size:0; }
  #mobile-navigation button[popovertargetaction="hide"]::before,
  #mobile-navigation button[popovertargetaction="hide"]::after { content:""; position:absolute; top:50%; left:50%; width:24px; height:2px; background:currentColor; transform:translate(-50%,-50%) rotate(45deg); }
  #mobile-navigation button[popovertargetaction="hide"]::after { transform:translate(-50%,-50%) rotate(-45deg); }
  @media (max-width: 640px) {
    .desktop-navigation,header > nav > a[href="/admin"] { display:none; }
    .mobile-menu-toggle { display:inline-flex; margin-left:auto; }
  }
  .contact-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; gap:var(--space-xl); }
  @media (max-width: 760px) { .contact-layout { grid-template-columns:minmax(0,1fr); } }
  .team-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--space-md); }
  .team-grid article > :last-child > p:last-child { margin-bottom:0; }
  @media (max-width: 900px) { .team-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
  @media (max-width: 560px) { .team-grid { grid-template-columns:minmax(0,1fr); } }
  /* Global styles go here */
  nav > a,.desktop-navigation > a {
    text-decoration: none;
    color: var(--darker);
  }

  /* Full-height shell with independently scrolling navigation and editing. */
  .admin-shell {
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }
  .admin-main { min-height: 0; overflow: auto; }
  .admin-workspace {
    height: 100%;
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
  }
  .admin-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .admin-page-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
  .admin-page-list a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
  }
  .admin-page-list a[aria-current="page"] {
    background: var(--white);
    color: var(--black);
    font-weight: var(--font-semibold);
  }
  .admin-content { min-width: 0; overflow-y: auto; }
  .admin-panel { max-width: 56rem; }
  @media (max-width: 640px) {
    .admin-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 30dvh) minmax(0, 1fr); }
  }

  /* ------------------------------------------------------------------
     King Floyd's homepage — only what Prewind utilities can't express
     (grid layouts, the Barbary Coast hero, the ivory bottle medallion,
     wordmark sizing, and link hover states). Everything else in markup.
     ------------------------------------------------------------------ */
  .kf-header {
    background: color-mix(in srgb, var(--lighter) 96%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--light);
    color: var(--darker);
  }
  .kf-logo { height: clamp(1.9rem, 4vw, 2.9rem); width: auto; max-width: 100%; display: block; }
  .kf-nav a {
    text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--text-sm);
    font-weight: 600; text-decoration: none; color: var(--dark);
    border-bottom: 1px solid transparent; padding-block: 0.35rem;
  }
  .kf-nav a:hover { color: var(--brand-1); border-bottom-color: var(--brand-1); }

  .kf-hero {
    position: relative; overflow: hidden;
    background: #141210 url("/images/barbary-coast.jpg") center / cover no-repeat;
  }
  .kf-hero .glow {
    position: absolute; inset: 0;
    background:
      linear-gradient(90deg, rgba(8,6,5,0.90) 0%, rgba(8,6,5,0.60) 36%, rgba(8,6,5,0.10) 64%, rgba(8,6,5,0.28) 100%),
      linear-gradient(180deg, rgba(8,6,5,0.30) 0%, rgba(8,6,5,0) 32%, rgba(8,6,5,0.45) 100%);
  }
  .kf-hero-grid { position: relative; z-index: 2; min-height: min(74vh, 660px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; }
  .kf-hero-copy { max-width: 44ch; }
  .kf-hero-title { font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.03; letter-spacing: -0.01em; }
  .kf-hero-figure { position: relative; display: grid; place-items: center; }
  .kf-hero-figure::before {
    content: ""; position: absolute; width: min(34rem, 92%); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(245,239,226,0.16), rgba(169,121,47,0.10) 46%, transparent 72%);
    pointer-events: none;
  }
  .kf-bottle {
    position: relative; height: clamp(19rem, 50vh, 31rem); width: auto; display: block;
    filter: drop-shadow(0 28px 46px rgba(0,0,0,0.6));
  }
  @media (prefers-reduced-motion: no-preference) {
    .kf-hero-figure { animation: kf-rise 900ms cubic-bezier(.16,.84,.24,1) both; }
    .kf-hero-copy { animation: kf-rise 900ms cubic-bezier(.16,.84,.24,1) 80ms both; }
    @keyframes kf-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  }

  .kf-lineup { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kf-card { display: flex; flex-direction: column; }
  .kf-card-frame {
    position: relative; display: flex; align-items: flex-end; justify-content: center; aspect-ratio: 3 / 4;
    background: var(--white); border: 1px solid var(--light); border-radius: 4px; overflow: hidden;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  }
  .kf-card:hover .kf-card-frame { transform: translateY(-4px); border-color: var(--brand-1); box-shadow: 0 18px 34px -18px rgba(27,24,21,.45); }
  .kf-card img { height: 100%; width: auto; max-width: 100%; display: block; }

  .kf-craft { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kf-craft article { border-top: 2px solid var(--brand-3); }

  .kf-story { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .kf-story-quote { font-family: var(--font-heading); font-weight: 400; font-size: var(--text-xl); line-height: 1.4; letter-spacing: -0.005em; margin: 0; padding: 0; border: 0; }
  .kf-story figure img { max-height: 560px; width: auto; height: auto; display: block; margin-inline: auto; }

  .kf-footer a { color: color-mix(in srgb, var(--white) 80%, transparent); text-decoration: none; }
  .kf-footer a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 0.2em; }
  .kf-footer address { font-style: normal; }
  .kf-footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; }

  @media (max-width: 900px) {
    .kf-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .kf-hero-figure { order: -1; }
    .kf-hero-copy { max-width: none; }
    .kf-lineup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kf-craft { grid-template-columns: minmax(0, 1fr); }
    .kf-story { grid-template-columns: minmax(0, 1fr); }
    .kf-footer-grid { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 640px) {
    .kf-nav { display: none; }
    .kf-logo { height: 1.8rem; }
    .kf-lineup { grid-template-columns: minmax(0, 1fr); }
    .kf-footer-grid { grid-template-columns: 1fr; }
  }
}
