/*
Theme Name: Adlook
Theme URI: https://adlook.fun/
Author: Codex
Description: Masonry advertising case browser with external video embeds and multi-dimensional filters.
Version: 1.2.2
Requires at least: 6.0
Text Domain: adlook
*/

:root {
  --ink: #171717;
  --muted: #6b6b6b;
  --line: #e6e1d8;
  --paper: #faf9f5;
  --panel: #ffffff;
  --accent: #ff0909;
  --accent-dark: #d80000;
  --sage: #40675a;
  --gold: #b98722;
  --shadow: 0 14px 34px rgba(20, 20, 18, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(232, 226, 216, 0.85);
  background: rgba(250, 249, 245, 0.92);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 13px 28px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 820;
  letter-spacing: 0;
}

.brand-mark__symbol {
  width: 38px;
  height: 38px;
  display: block;
  flex: 0 0 auto;
}

.brand-mark__name {
  font-size: 20px;
  font-weight: 860;
}

.brand-mark__name span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 620;
}

.site-nav a:hover {
  color: var(--ink);
}

.search-hero {
  max-width: 1600px;
  margin: 0 auto;
  padding: 76px 42px 78px;
  text-align: center;
}

.portal-logo {
  width: min(760px, 62vw);
  margin: 0 auto 54px;
  line-height: 0;
}

.portal-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.portal-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  width: min(1420px, 100%);
  height: 78px;
  margin: 0 auto;
  overflow: hidden;
  border: 5px solid var(--accent);
  border-radius: 999px;
  background: #fff;
}

.portal-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 34px;
  color: var(--ink);
  font-size: 32px;
  text-align: center;
  outline: 0;
}

.portal-search input::placeholder {
  color: #9b9b9b;
}

.portal-search button {
  display: grid;
  place-items: center;
  border: 0;
  background: var(--accent);
  cursor: pointer;
}

.portal-search button:hover {
  background: var(--accent-dark);
}

.portal-search button span {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border: 7px solid #000;
  border-radius: 50%;
}

.portal-search button span::after {
  position: absolute;
  right: -20px;
  bottom: 0;
  width: 28px;
  height: 8px;
  border-radius: 999px;
  background: #000;
  content: "";
  transform: rotate(28deg);
  transform-origin: left center;
}

.browse-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 42px 70px;
}

.filters {
  position: sticky;
  top: 78px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 18, 17, 0.04);
}

.filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.filters__title {
  margin: 0;
  font-size: 19px;
  font-weight: 820;
}

.text-button {
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
}

.filter-group {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.filter-group:last-child {
  border-bottom: 0;
}

.filter-group__title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
}

.check-item:hover,
.check-item:has(input:checked) {
  border-color: var(--line);
  background: #fff;
}

.check-item__main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.check-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.check-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 620;
}

.check-item__count {
  color: var(--muted);
  font-size: 12px;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -16px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

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

.collection-row {
  margin-bottom: 30px;
}

.collection-pill {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border-radius: 999px;
  background: #050505;
  padding: 0 20px;
  color: #fff;
  font-size: 30px;
  font-weight: 560;
  line-height: 1;
}

.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
}

.active-tag::after {
  margin-left: 6px;
  color: var(--accent);
  content: "×";
}

.masonry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 20px;
}

.case-card {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(16, 16, 15, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  content-visibility: auto;
  contain-intrinsic-size: 330px;
}

.case-card:hover {
  transform: translateY(-3px);
  border-color: rgba(226, 61, 40, 0.36);
  box-shadow: var(--shadow);
}

.case-card[hidden] {
  display: none;
}

.case-poster {
  position: relative;
  display: flex;
  min-height: 236px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.18)),
    var(--poster-bg, linear-gradient(135deg, #1f1f1f, #7f372d));
}

.case-poster::after {
  position: absolute;
  inset: auto -20% -35% 18%;
  height: 72%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  content: "";
  transform: rotate(-18deg);
}

.case-poster__image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 220ms ease, filter 220ms ease;
}

.case-card:hover .case-poster__image {
  transform: scale(1.045);
}

.case-poster__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.08) 42%, rgba(0, 0, 0, 0.72)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 55%);
}

.case-card--has-cover .case-poster::after {
  opacity: 0;
}

.case-poster__award {
  position: relative;
  z-index: 2;
  max-width: 92%;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.case-poster__title {
  position: relative;
  z-index: 2;
  margin-top: 74px;
}

.case-poster__title span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 680;
}

.case-poster__title strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.lock-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.36);
  padding: 5px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
  backdrop-filter: blur(8px);
}

.play-badge {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.play-badge:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.case-card--locked .case-poster__image {
  filter: saturate(0.72) brightness(0.72);
}

.play-badge::before {
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #fff;
  content: "";
}

.case-card__body {
  padding: 16px 18px 18px;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.case-chip {
  border-radius: 999px;
  background: #f1eee7;
  padding: 6px 10px;
  color: #5d5a54;
  font-size: 13px;
  font-weight: 650;
}

.case-card h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.28;
}

.case-brand {
  display: none;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.case-desc {
  display: none;
  margin: 13px 0 0;
  overflow: hidden;
  color: #4c4c4c;
  font-size: 14px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.case-actions {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.case-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.case-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.case-action--primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.case-action--primary:hover {
  color: #fff;
  background: var(--accent-dark);
}

.empty-state {
  display: none;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

.empty-state.is-visible {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 11, 10, 0.76);
}

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

.modal__panel {
  width: min(1080px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: #0f0f0f;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  color: #fff;
}

.modal__title {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.modal__close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.modal__frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.single-case {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 28px 80px;
}

.single-case__kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
}

.single-case h1 {
  max-width: 900px;
  margin: 0;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 68px;
  line-height: 1;
}

.single-case__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 22px 0 28px;
}

.video-embed {
  overflow: hidden;
  border-radius: 8px;
  background: #0f0f0f;
}

.video-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-embed--cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.single-case__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 34px;
  margin-top: 34px;
}

.single-case__content {
  font-size: 17px;
  line-height: 1.86;
}

.single-case__aside {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.info-row {
  border-bottom: 1px solid var(--line);
  padding: 0 0 13px;
  margin-bottom: 13px;
}

.info-row:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.info-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.info-row strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.4;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 28px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.member-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 360px) minmax(240px, 360px);
  gap: 22px;
  max-width: 1480px;
  margin: 0 auto 70px;
  padding: 28px;
  border-top: 1px solid var(--line);
}

.member-panel--account {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.member-panel__intro h2,
.member-form h3 {
  margin: 0;
}

.member-panel__intro h2 {
  max-width: 620px;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 38px;
  line-height: 1.08;
}

.member-panel__intro p {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.7;
}

.member-form {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 18px;
}

.member-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.member-form input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
}

.member-form input:focus {
  border-color: var(--ink);
  outline: 0;
}

.inline-choice {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.auth-message {
  display: inline-flex;
  border: 1px solid rgba(226, 61, 40, 0.28);
  border-radius: 8px;
  background: rgba(226, 61, 40, 0.08);
  padding: 8px 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 720;
}

.locked-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
}

@media (max-width: 1240px) {
  .masonry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-logo {
    width: min(660px, 68vw);
  }

  .portal-search {
    grid-template-columns: minmax(0, 1fr) 170px;
  }

  .member-panel {
    grid-template-columns: 1fr 1fr;
  }

  .member-panel__intro {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .browse-layout {
    grid-template-columns: 1fr;
    padding-inline: 28px;
  }

  .filters {
    position: static;
    max-height: none;
  }

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

  .single-case__grid {
    grid-template-columns: 1fr;
  }

  .search-hero {
    padding: 56px 28px 50px;
  }

  .portal-logo {
    width: min(560px, 78vw);
  }

  .portal-search {
    grid-template-columns: minmax(0, 1fr) 120px;
    height: 66px;
    border-width: 4px;
  }

  .portal-search input {
    font-size: 24px;
  }

  .portal-search button span {
    width: 36px;
    height: 36px;
    border-width: 6px;
  }

  .single-case h1 {
    font-size: 52px;
  }

  .member-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header__inner {
    align-items: center;
    padding: 12px 18px;
  }

  .brand-mark__name {
    max-width: 210px;
    font-size: 15px;
    line-height: 1.2;
  }

  .site-nav {
    width: auto;
    overflow: visible;
    gap: 10px;
    font-size: 13px;
  }

  .search-hero {
    padding: 44px 18px 36px;
  }

  .portal-logo {
    margin-bottom: 32px;
    width: min(360px, 82vw);
  }

  .portal-search {
    grid-template-columns: minmax(0, 1fr) 78px;
    height: 54px;
    border-width: 3px;
  }

  .portal-search input {
    padding: 0 14px;
    font-size: 17px;
  }

  .portal-search button span {
    width: 27px;
    height: 27px;
    border-width: 5px;
  }

  .portal-search button span::after {
    right: -15px;
    width: 20px;
    height: 6px;
  }

  .browse-layout {
    padding: 0 18px 48px;
  }

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

  .result-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .collection-pill {
    min-height: 40px;
    font-size: 24px;
  }

  .single-case {
    padding: 32px 18px 58px;
  }

  .single-case h1 {
    font-size: 38px;
  }

  .case-poster__title strong {
    font-size: 25px;
  }

  .member-panel {
    margin-bottom: 44px;
    padding: 24px 18px;
  }

  .member-panel__intro h2 {
    font-size: 30px;
  }
}
