/* =========================
   Adsforcopy (Freepik-like) CSS
   ========================= */

/* 1) TOKENS / THEME */
:root {
  /* Design tokens */
  --card: #262626;
  --ring: #f59e0b;
  --input: #404040;
  --muted: #b3b3b3;
  --accent: #92400e;
  --border: #404040;
  --radius: 0.375rem;
  --chart-1: #fbbf24;
  --chart-2: #d97706;
  --chart-3: #92400e;
  --chart-4: #b45309;
  --chart-5: #92400e;
  --popover: #262626;
  --primary: #f59e0b;
  --sidebar: #0f0f0f;
  --spacing: 0.25rem;
  --font-mono: "JetBrains Mono", monospace;
  --font-sans: Inter, sans-serif;
  --secondary: #262626;
  --background: #171717;
  --font-serif: "Source Serif 4", serif;
  --foreground: #ffffff;
  --destructive: #ef4444;
  --shadow-blur: 8px;
  --shadow-color: hsl(0 0% 0%);
  --sidebar-ring: #f59e0b;
  --shadow-spread: -1px;
  --letter-spacing: 0em;
  --shadow-opacity: 0.18;
  --sidebar-accent: #92400e;
  --sidebar-border: #404040;
  --card-foreground: #ffffff;
  --shadow-offset-x: 0px;
  --shadow-offset-y: 4px;
  --sidebar-primary: #f59e0b;
  --muted-foreground: #b3b3b3;
  --accent-foreground: #fde68a;
  --popover-foreground: #ffffff;
  --primary-foreground: #000000;
  --sidebar-foreground: #ffffff;
  --secondary-foreground: #ffffff;
  --destructive-foreground: #ffffff;
  --sidebar-accent-foreground: #fde68a;
  --sidebar-primary-foreground: #ffffff;

  /* App semantic mappings */
  --bg: var(--background);
  --panel: #1c1c1c;
  --panel-2: var(--secondary);
  --surface: var(--card);
  --surface-2: #303030;

  --text: var(--foreground);
  --text-strong: #ffffff;

  --border-2: #525252;

  --shadow: 0 var(--shadow-offset-y) calc(var(--shadow-blur) * 3) rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 var(--shadow-offset-y) calc(var(--shadow-blur) * 2) rgba(0, 0, 0, 0.24);

  /* Brand */
  --brand-yellow: #f59e0b;
  --brand-red: #ef4444;
  --brand-ash: #e5e7eb;
  --brand-black: #171717;

  /* Accent */
  --accent-2: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.18);
  --accent-soft-2: rgba(217, 119, 6, 0.16);
  --btn-text: var(--primary-foreground);

  /* Radii */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --radius-lg: 16px;
  --r-lg: 22px;

  /* Spacing */
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 18px;
  --s-5: 24px;
  --s-6: 32px;

  /* Sizing */
  --sidebar-w: 260px;
  --topbar-h: 76px;

  /* Type */
  --font: var(--font-sans);
}

:root[data-theme="light"] {
  --card: #ffffff;
  --ring: #f59e0b;
  --input: #e5e7eb;
  --muted: #5f6673;
  --accent: #fffbeb;
  --border: #e5e7eb;
  --chart-1: #f59e0b;
  --chart-2: #d97706;
  --chart-3: #b45309;
  --chart-4: #92400e;
  --chart-5: #78350f;
  --popover: #ffffff;
  --primary: #f59e0b;
  --sidebar: #f9fafb;
  --secondary: #f3f4f6;
  --background: #ffffff;
  --foreground: #000000;
  --destructive: #ef4444;
  --sidebar-ring: #f59e0b;
  --sidebar-accent: #fffbeb;
  --sidebar-border: #e5e7eb;
  --card-foreground: #000000;
  --sidebar-primary: #f59e0b;
  --muted-foreground: #5f6673;
  --accent-foreground: #92400e;
  --popover-foreground: #000000;
  --primary-foreground: #000000;
  --sidebar-foreground: #000000;
  --secondary-foreground: #000000;
  --destructive-foreground: #ffffff;
  --sidebar-accent-foreground: #92400e;
  --sidebar-primary-foreground: #ffffff;
  --shadow-opacity: 0.1;

  --bg: var(--background);
  --panel: #fcfcfd;
  --panel-2: #f5f6f8;
  --surface: var(--card);
  --surface-2: #f9fafb;

  --text: var(--foreground);
  --text-strong: #000000;

  --border-2: #d1d5db;

  --shadow: 0 var(--shadow-offset-y) calc(var(--shadow-blur) * 3) rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 var(--shadow-offset-y) calc(var(--shadow-blur) * 2) rgba(0, 0, 0, 0.05);

  --brand-yellow: #f59e0b;
  --brand-red: #ef4444;
  --brand-ash: #e5e7eb;
  --brand-black: #171717;

  --accent-2: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --accent-soft-2: rgba(217, 119, 6, 0.1);
  --btn-text: var(--primary-foreground);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  /* Prevent accidental horizontal scroll on mobile */
  overflow-x: hidden;
}

/* Media should never overflow the viewport */
img, video { max-width: 100%; }

/* Links / focus */
a{ color:inherit; text-decoration:none; }
:focus-visible{
  outline: 2px solid rgba(255,49,49,.55);
  outline-offset: 2px;
}

/* Scrollbar (optional) */
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.14); border-radius: 999px; }
*::-webkit-scrollbar-track{ background: rgba(255,255,255,.06); }
:root[data-theme="light"] *::-webkit-scrollbar-thumb{ background: rgba(15,23,32,.24); }
:root[data-theme="light"] *::-webkit-scrollbar-track{ background: rgba(15,23,32,.08); }
/* Utility */
.muted{ color: var(--muted); }
.hidden{ display:none !important; }

/* =========================
   2) APP SHELL (DESKTOP)
   ========================= */
.afc-shell{
  display:grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height:100vh;
  background: var(--bg);
}

/* Sidebar */
.afc-sidebar{
  position: sticky;
  top:0;
  height:100vh;
  padding: var(--s-5) var(--s-4) var(--s-4) var(--s-4);
  background: var(--bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Mobile sidebar overlay + drawer */
.afc-sidebar-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  border:none;
  z-index: 199;
}
.afc-sidebar-overlay.is-open{
  display:block;
  opacity:1;
  pointer-events:auto;
}

.afc-sidebar-close{
  display:none;
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.afc-sidebar-close:hover{ background: rgba(255,255,255,.06); }
@media (max-width: 1100px){
  /* Sidebar becomes a left drawer */
  .afc-sidebar{
    display:none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 86vw);
    z-index: 200;
    height: 100vh;
    border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
    transform: translateX(-102%);
    transition: transform .22s ease;
  }
  .afc-sidebar.is-mobile-open{
    display:block;
    transform: translateX(0);
  }
  .afc-sidebar-close{ display:inline-flex; }
}


.afc-brand{
  display:flex;
  align-items:center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.afc-brand__logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 12px 26px rgba(255,49,49,.24), 0 0 0 6px rgba(255,189,89,.12);
}
.afc-brand__name{
  font-weight: 800;
  letter-spacing: .6px;
}

/* Sidebar nav */
.afc-nav{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.afc-nav a{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
}
.afc-nav a:hover{
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
}
.afc-nav a.is-active{
  background: rgba(255,189,89,.18);
  color: var(--text);
  border: 1px solid rgba(255,49,49,.24);
}

/* Main column */
.afc-main{
  padding: var(--s-5);
  background: var(--bg);
  min-height: 100vh;
}

/* =========================
   3) TOP BAR (DESKTOP)
   ========================= */
.afc-topbar{
  position: sticky;
  top:0;
  z-index: 20;
  display:flex;
  align-items:center;
  gap: var(--s-3);
  height: var(--topbar-h);
  padding: var(--s-3) 0;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .afc-topbar{
  background: color-mix(in srgb, #ffffff 90%, transparent);
}
:root[data-theme="light"] .afc-mobile-header{
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.74));
}
/* Search pill */
.afc-search{
  flex:1;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
}
.afc-search:hover{ border-color: var(--border-2); }
.afc-search input{
  width:100%;
  background: transparent;
  border:0;
  outline: none;
  color: var(--text);
  font-size: 15px;
}
.afc-search input::placeholder{ color: color-mix(in srgb, var(--muted) 88%, transparent); }
.afc-search__icon{
  width: 18px; height: 18px; opacity: .75;
}

/* Hire CTA */
.afc-hire-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #171717;
  font-weight: 700;
  cursor:pointer;
  white-space: nowrap;
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.2);
}
.afc-hire-btn:hover{
  background: #f59e0b;
  color: #171717;
}
.afc-hire-btn:active{
  transform: translateY(1px);
}

/* =========================
   4) RESULTS HEADER + FILTER CHIPS
   ========================= */
.afc-results-head{
  display:flex;
  align-items: baseline;
  gap: 12px;
  margin-top: var(--s-4);
}
.afc-results-head h1{
  font-size: 22px;
  margin:0;
  font-weight: 800;
}
.afc-results-head .count{
  color: var(--muted);
  font-size: 14px;
}

.afc-filters-row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: var(--s-4);
  flex-wrap: wrap;
}

.afc-chip{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  cursor:pointer;
  font-weight: 600;
  font-size: 13px;
}
.afc-chip:hover{ border-color: var(--border-2); }
.afc-chip.is-active{
  background: rgba(255,189,89,.18);
  border-color: rgba(255,49,49,.24);
}
.afc-chip .chev{ opacity: .8; }

/* Sort (right aligned on desktop) */
.afc-sort{
  margin-left: auto;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.afc-sort:hover{ color: var(--text); border-color: var(--border-2); }

/* =========================
   5) GRID (FREEPIK-LIKE)
   ========================= */
.afc-grid{
  margin-top: var(--s-5);
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

/* Responsive columns */
@media (max-width: 1400px){
  .afc-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px){
  .afc-shell{ grid-template-columns: 1fr; }
  .afc-sidebar{ display:none; }
  .afc-sidebar.is-mobile-open{ display:block; }
  .afc-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px){
  .afc-main{ padding: 16px; }
  .afc-topbar{ height: auto; padding: 12px 0; }
  .afc-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 420px){
  .afc-grid{ grid-template-columns: 1fr; }
}

/* Card */
.afc-card{
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  aspect-ratio: 9 / 16;
  cursor: pointer;
  box-shadow: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.afc-card:hover{
  transform: translateY(-2px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-soft);
}

/* Touch devices: disable hover lift (prevents stuck hover states on iOS) */
@media (hover: none) and (pointer: coarse){
  .afc-card:hover{
    transform: none;
    box-shadow: none;
  }
}
.afc-card__media{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.afc-card__badges{
  position:absolute;
  top: 12px;
  left: 12px;
  display:flex;
  gap: 8px;
}
.afc-badge{
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.40);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 12px;
  color: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
}

/* =========================
   6) MODAL VIEWER (DESKTOP)
   ========================= */
.afc-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,.66);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 20px;
}

.afc-modal{
  width: min(1200px, 98vw);
  height: min(720px, 92vh);
  border-radius: 18px;
  overflow:hidden;
  background: #0d1018;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  display:grid;
  grid-template-columns: 1fr 360px;
}

.afc-modal__viewer{
  background: #0a0c12;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.afc-modal__viewer img,
.afc-modal__viewer video{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.afc-modal__side{
  border-left: 1px solid rgba(255,255,255,.10);
  padding: 18px;
  overflow:auto;
  background: rgba(255,255,255,.02);
}

/* Modal top row */
.afc-modal__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.afc-icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.afc-icon-btn:hover{ border-color: rgba(255,255,255,.18); }

.afc-section{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.afc-section h3{
  margin:0 0 10px 0;
  font-size: 14px;
  color: rgba(255,255,255,.85);
  letter-spacing: .2px;
}

/* Prompt box */
.afc-prompt{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 12px;
}
.afc-prompt pre{
  margin:0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  color: rgba(255,255,255,.88);
}
.afc-copy-btn{
  margin-top: 10px;
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  cursor:pointer;
  font-weight: 700;
  color: var(--text);
}
.afc-copy-btn:hover{ border-color: rgba(255,255,255,.18); }

/* =========================
   7) MOBILE MODE (Freepik-like)
   ========================= */
.afc-mobile-header{
  display:none;
}
.afc-mobile-filters{
  display:none;
}

@media (max-width: 720px){
  /* Hide desktop chrome */
  .afc-sidebar{ display:none; }
  .afc-sidebar.is-mobile-open{ display:block; }
  .afc-topbar{ display:none; }

  /* Mobile header */
  .afc-mobile-header{
    display:block;
    position: sticky;
    top:0;
    z-index: 25;
    padding: 14px 0 10px 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, transparent), color-mix(in srgb, var(--bg) 58%, transparent));
    backdrop-filter: blur(10px);
  }

  .afc-mh-row1{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
    padding: 0 16px 10px 16px;
  }

  .afc-mh-left{
    display:flex;
    align-items:center;
    gap: 10px;
  }

  .afc-mh-brand{
    font-weight: 900;
    letter-spacing: .5px;
  }

  .afc-avatar{
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.10);
  }


  .afc-mh-search{
    margin: 0 16px;
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid rgba(255,255,255,.10);
  }
  .afc-mh-search input{
    width:100%;
    background: transparent;
    border:0;
    outline:none;
    color: var(--text);
    font-size: 15px;
  }

  /* Mobile results row */
  .afc-results-head{
    padding: 0 16px;
  }

  /* Mobile segmented filters row */
  .afc-mobile-filters{
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 12px 16px 0 16px;
  }
  .afc-seg{
    flex: 1;
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid rgba(255,255,255,.10);
    cursor:pointer;
    font-weight: 700;
    color: rgba(255,255,255,.86);
    font-size: 13px;
  }
  .afc-seg.icon{
    flex: 0 0 54px;
    padding: 12px 0;
  }
  /* ---------- Gallery header + grid (mobile) ---------- */
  .afc-results-head{
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "filters sort"
      "count count";
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
  }
  .afc-results-head-left{ grid-area: filters; width: 100%; }
  .afc-results-head-right{ grid-area: sort; width: 100%; display: flex; justify-content: flex-end; }
  .afc-results-head .count{
    grid-area: count;
    margin-top: -2px;
    font-size: 13px;
    color: var(--muted);
  }

  .afc-filter-btn{
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .afc-sort-control{ width: 100%; }
  .afc-sort-control select{
    width: 100%;
    min-height: 44px;
  }

  /* Two-column grid on mobile */
  .afc-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  /* Keep cards consistent in 2-col grid */
  .afc-card{
    aspect-ratio: 9 / 16;
    height: auto;
  }


}

/* =========================
   8) FULLSCREEN MODAL ON MOBILE
   ========================= */
@media (max-width: 720px){
  .afc-modal{
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    grid-template-columns: 1fr;
  }
  .afc-modal__side{
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.10);
  }
}

/* =========================
   9) BOTTOM SHEET (Filters/Sort)
   ========================= */
.afc-sheet-overlay{
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0,0,0,.62);
  display:flex;
  align-items:flex-end;
  justify-content:center;
}

.afc-sheet{
  width: 100%;
  max-width: 720px;
  border-radius: 18px 18px 0 0;
  background: #0d1018;
  border: 1px solid rgba(255,255,255,.12);
  padding: 14px 14px 20px 14px;
  box-shadow: var(--shadow);
}
.afc-sheet__handle{
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  margin: 6px auto 14px auto;
}
.afc-sheet__title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 6px 10px 6px;
}
.afc-sheet__title h3{
  margin:0;
  font-size: 14px;
  color: rgba(255,255,255,.86);
}
.afc-sheet__content{
  padding: 0 6px;
}

/* =========================
   10) SKELETON LOADING (Grid)
   ========================= */
.afc-skel{
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid rgba(255,255,255,.08);
  aspect-ratio: 16/10;
  overflow:hidden;
  position:relative;
}
.afc-skel::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transform: translateX(-100%);
  animation: afc-shimmer 1.2s infinite;
}
@keyframes afc-shimmer{
  to{ transform: translateX(100%); }
}


/* =========================
   Mobile Bottom Bar + Search Sheet
   ========================= */
.afc-mobilebar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: none;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  gap: 6px;
  grid-template-columns: repeat(5, 1fr);
}
.afc-mobilebar__btn{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.afc-mobilebar__btn.is-active{ color: var(--text-strong, var(--text)); }
.afc-mobilebar__btn:active{ transform: scale(.98); }
.afc-mobilebar__iconwrap{ position: relative; display: inline-flex; align-items:center; justify-content:center; }
.afc-mobilebar__badge{
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--btn-text);
  font-size: 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

@media (max-width: 720px){
  .afc-mobilebar{ display: grid; }
  /* Ensure content isn't hidden behind the bar */
  .afc-main{ padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}

/* Search sheet */
.afc-sheet{ position: fixed; inset: 0; z-index: 250; }
.afc-sheet__backdrop{ position: absolute; inset: 0; border: none; background: rgba(0,0,0,.45); }
.afc-sheet__panel{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  animation: afcSheetUp 180ms ease-out;
}
@keyframes afcSheetUp{
  from{ transform: translateY(14px); opacity: .85; }
  to{ transform: translateY(0); opacity: 1; }
}
.afc-sheet__header{ position: relative; padding: 10px 14px 0; display:flex; justify-content:center; }
.afc-sheet__grab{ width: 42px; height: 4px; border-radius: 999px; background: var(--border); opacity: .9; }
.afc-sheet__close{
  position: absolute;
  right: 10px;
  top: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
}
.afc-sheet__content{ padding: 12px 14px 16px; }
.afc-sheet__searchrow{
  display:flex;
  align-items:center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}
.afc-sheet__input{
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px; /* prevent iOS zoom */
}
.afc-sheet__submit{
  border: none;
  background: var(--accent);
  color: var(--btn-text);
  font-weight: 900;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 40px;
  cursor: pointer;
}
.afc-sheet__hint{ margin: 10px 2px 0; font-size: 12px; color: var(--muted); }

/* =========================
   Card Meta Overlay (Gallery)
   ========================= */
.afc-card__veil{
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.04) 0%, rgba(0,0,0,.22) 52%, rgba(0,0,0,.78) 100%),
    radial-gradient(160% 70% at 50% -20%, rgba(255,255,255,.24), transparent 48%);
  transition: opacity .18s ease;
  pointer-events:none;
}

.afc-card__meta{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding: 10px;
  z-index:2;
  pointer-events:none;
}

.afc-card__meta-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.afc-card__type,
.afc-card__brand{
  display:inline-flex;
  align-items:center;
  padding: 5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  color:#fff;
  background: rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  text-transform: capitalize;
}

.afc-card__brand{
  max-width: 58%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.afc-card__meta-bottom{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.afc-card__title{
  margin:0;
  color:#fff;
  font-size:14px;
  font-weight:800;
  line-height:1.28;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.afc-card__stats{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}

.afc-card__stat{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding: 4px 8px;
  border-radius:999px;
  font-size:11px;
  color: rgba(255,255,255,.95);
  background: rgba(0,0,0,.42);
  border:1px solid rgba(255,255,255,.16);
}

.afc-card__preview-hint{
  display:inline-flex;
  align-items:center;
  gap:5px;
  width:fit-content;
  padding: 4px 8px;
  border-radius:8px;
  font-size:10px;
  letter-spacing:.02em;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.14);
}

.afc-card:hover .afc-card__veil{
  opacity:.92;
}

:root[data-theme="light"] .afc-card__veil{
  background:
    linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.14) 44%, rgba(0,0,0,.56) 100%),
    radial-gradient(160% 70% at 50% -20%, rgba(255,255,255,.42), transparent 48%);
}

@media (max-width: 720px){
  .afc-card__meta{
    padding: 8px;
  }

  .afc-card__title{
    font-size:13px;
  }

  .afc-card__type,
  .afc-card__brand,
  .afc-card__stat{
    font-size:10px;
  }
}












/* Shared hero motion */
.afc-gal-hero,
.afc-community-hero,
.afc-col-hero,
.afc-col-detail-hero,
.afc-info-hero,
.afc-prof-hero,
.afc-blog-hero{
  position: relative !important;
  overflow: hidden !important;
  background-size: 115% 115%, 120% 120%, 120% 120%, 100% 100% !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 30px 70px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03) !important;
  animation: afc-shared-hero-shift 18s ease-in-out infinite alternate !important;
  will-change: transform, background-position, box-shadow;
}

.afc-gal-hero::before,
.afc-gal-hero::after,
.afc-community-hero::before,
.afc-community-hero::after,
.afc-col-hero::before,
.afc-col-hero::after,
.afc-col-detail-hero::before,
.afc-col-detail-hero::after,
.afc-info-hero::before,
.afc-info-hero::after,
.afc-prof-hero::before,
.afc-prof-hero::after,
.afc-blog-hero::before,
.afc-blog-hero::after{
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.afc-gal-hero::before,
.afc-community-hero::before,
.afc-col-hero::before,
.afc-col-detail-hero::before,
.afc-info-hero::before,
.afc-prof-hero::before,
.afc-blog-hero::before{
  width: 230px;
  height: 230px;
  right: -70px;
  top: -80px;
  background: radial-gradient(circle, rgba(255,255,255,.24), rgba(255,255,255,0));
  animation: afc-shared-orb-a 14s ease-in-out infinite !important;
}

.afc-gal-hero::after,
.afc-community-hero::after,
.afc-col-hero::after,
.afc-col-detail-hero::after,
.afc-info-hero::after,
.afc-prof-hero::after,
.afc-blog-hero::after{
  width: 300px;
  height: 300px;
  left: -140px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(255,112,67,.26), rgba(255,112,67,0));
  animation: afc-shared-orb-b 17s ease-in-out infinite !important;
}

.afc-principles-hero{
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 34px 78px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.03) !important;
}

.afc-gal-hero h1,
.afc-gal-hero h2,
.afc-gal-hero h3,
.afc-community-hero h1,
.afc-community-hero h2,
.afc-community-hero h3,
.afc-col-hero h1,
.afc-col-hero h2,
.afc-col-hero h3,
.afc-col-detail-hero h1,
.afc-col-detail-hero h2,
.afc-col-detail-hero h3,
.afc-info-hero h1,
.afc-info-hero h2,
.afc-info-hero h3,
.afc-prof-hero h1,
.afc-prof-hero h2,
.afc-prof-hero h3,
.afc-blog-hero h1,
.afc-blog-hero h2,
.afc-blog-hero h3,
.afc-principles-hero h1,
.afc-principles-hero h2,
.afc-principles-hero h3,
.afc-support-hero h1,
.afc-support-hero h2,
.afc-support-hero h3{
  color: var(--text-strong) !important;
}

.afc-gal-hero p,
.afc-gal-hero .muted,
.afc-community-hero p,
.afc-community-hero .muted,
.afc-col-hero p,
.afc-col-hero .muted,
.afc-col-detail-hero p,
.afc-col-detail-hero .muted,
.afc-info-hero p,
.afc-info-hero .muted,
.afc-prof-hero p,
.afc-prof-hero .muted,
.afc-blog-hero p,
.afc-blog-hero .muted,
.afc-principles-hero p,
.afc-principles-hero .muted,
.afc-support-hero p,
.afc-support-hero .muted{
  color: color-mix(in srgb, var(--text) 76%, transparent) !important;
}

.afc-gal-hero [class*="badge"],
.afc-community-hero [class*="badge"],
.afc-col-hero [class*="badge"],
.afc-col-detail-hero [class*="badge"],
.afc-info-hero [class*="badge"],
.afc-prof-hero [class*="badge"],
.afc-blog-hero [class*="badge"],
.afc-principles-hero [class*="badge"],
.afc-support-hero [class*="badge"]{
  color: var(--text-strong) !important;
}

:root[data-theme="light"] .afc-gal-hero,
:root[data-theme="light"] .afc-community-hero,
:root[data-theme="light"] .afc-col-hero,
:root[data-theme="light"] .afc-col-detail-hero,
:root[data-theme="light"] .afc-info-hero,
:root[data-theme="light"] .afc-prof-hero,
:root[data-theme="light"] .afc-blog-hero{
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 24px 52px rgba(24,39,75,.12), 0 10px 28px rgba(15,23,32,.06) !important;
}

:root[data-theme="light"] .afc-gal-hero p,
:root[data-theme="light"] .afc-community-hero p,
:root[data-theme="light"] .afc-col-hero p,
:root[data-theme="light"] .afc-col-detail-hero p,
:root[data-theme="light"] .afc-info-hero p,
:root[data-theme="light"] .afc-prof-hero p,
:root[data-theme="light"] .afc-blog-hero p,
:root[data-theme="light"] .afc-principles-hero p,
:root[data-theme="light"] .afc-support-hero p{
  color: rgba(20,20,20,.76) !important;
}

@keyframes afc-shared-hero-shift{
  0%{
    background-position: 0% 0%, 100% 0%, 50% 100%, 50% 50%;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 30px 70px rgba(0,0,0,.36), 0 0 0 1px rgba(255,255,255,.03);
  }
  100%{
    background-position: 7% 6%, 94% 5%, 46% 95%, 50% 50%;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 38px 84px rgba(0,0,0,.46), 0 0 0 1px rgba(255,255,255,.05);
  }
}

@keyframes afc-shared-orb-a{
  0%,100%{ transform: translate3d(0,0,0) scale(1); opacity:.8; }
  50%{ transform: translate3d(-10px,12px,0) scale(1.08); opacity:1; }
}

@keyframes afc-shared-orb-b{
  0%,100%{ transform: translate3d(0,0,0) scale(1); opacity:.72; }
  50%{ transform: translate3d(14px,-10px,0) scale(1.05); opacity:.94; }
}

@media (prefers-reduced-motion: reduce){
  .afc-gal-hero,
  .afc-gal-hero::before,
  .afc-gal-hero::after,
  .afc-community-hero,
  .afc-community-hero::before,
  .afc-community-hero::after,
  .afc-col-hero,
  .afc-col-hero::before,
  .afc-col-hero::after,
  .afc-col-detail-hero,
  .afc-col-detail-hero::before,
  .afc-col-detail-hero::after,
  .afc-info-hero,
  .afc-info-hero::before,
  .afc-info-hero::after,
  .afc-prof-hero,
  .afc-prof-hero::before,
  .afc-prof-hero::after,
  .afc-blog-hero,
  .afc-blog-hero::before,
  .afc-blog-hero::after,
  .afc-principles-hero{
    animation: none !important;
  }
}


