:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #071b3a;
  --muted: #69788f;
  --line: #dce6f2;
  --blue: #064f9f;
  --blue-dark: #061b42;
  --gold: #f5c44f;
  --gold-2: #e2a829;
  --shadow: 0 18px 45px rgba(6, 27, 66, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 196, 79, 0.18), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #edf3fb 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-dark);
  text-decoration: none;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.brand-mini img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(6, 27, 66, 0.16);
}

.top-instagram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  color: #fff;
  background: linear-gradient(135deg, #e1306c, #fd1d1d, #fcb045);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(225, 48, 108, 0.22);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(6, 27, 66, 0.98), rgba(6, 79, 159, 0.96)),
    radial-gradient(circle at 84% 16%, rgba(245, 196, 79, 0.55), transparent 18rem);
  border-bottom: 6px solid var(--gold);
}

.hero::before {
  content: "";
  position: absolute;
  width: 370px;
  height: 370px;
  right: -150px;
  top: -160px;
  border: 34px solid rgba(245, 196, 79, 0.16);
  border-radius: 999px;
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  left: -250px;
  bottom: -300px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  z-index: -1;
}

.hero-inner {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 26px);
}

.hero-logo {
  width: clamp(86px, 12vw, 128px);
  height: clamp(86px, 12vw, 128px);
  flex: 0 0 auto;
  object-fit: cover;
  background: #fff;
  border: 5px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.eyebrow,
.small-label {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.17em;
}

.eyebrow {
  color: var(--gold);
}

.small-label {
  color: var(--gold-2);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  max-width: 900px;
  color: #fff;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.93;
  letter-spacing: -0.075em;
  text-wrap: balance;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.subtitle {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(0.98rem, 1.8vw, 1.18rem);
  line-height: 1.55;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 28px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.search-card {
  padding: 16px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(6, 27, 66, 0.18);
}

.search-card label {
  display: block;
  margin-bottom: 9px;
  color: var(--blue-dark);
  font-weight: 950;
}

#searchInput {
  width: 100%;
  min-height: 54px;
  padding: 15px 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  color: var(--text);
  outline: none;
  font-weight: 650;
}

#searchInput:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(245, 196, 79, 0.20);
}

#searchInput::placeholder {
  color: #91a1b6;
  font-weight: 500;
}

.instagram-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px;
  color: #fff;
  background: linear-gradient(135deg, #e1306c, #fd1d1d, #fcb045);
  border-radius: 22px;
  text-decoration: none;
  box-shadow: 0 15px 36px rgba(225, 48, 108, 0.28);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.instagram-feature strong {
  display: block;
  font-size: 1.03rem;
  line-height: 1.2;
}

.instagram-feature small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.instagram-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
}

.instagram-icon svg,
.social-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.instagram-feature:hover,
.top-instagram:hover,
.social-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.layout {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 48px) 60px;
  display: grid;
  grid-template-columns: 305px minmax(0, 1fr);
  gap: 28px;
}

.sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 94px);
  overflow: auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar-header,
.content-header {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.sidebar h2,
.content h2 {
  margin-bottom: 0;
  font-size: clamp(1.28rem, 2vw, 1.75rem);
  letter-spacing: -0.055em;
}

.category-list {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.category-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  color: var(--text);
  text-align: left;
  font-weight: 800;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.category-button:hover {
  transform: translateX(3px);
  background: #eef6ff;
  border-color: rgba(6, 79, 159, 0.24);
}

.category-button.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  box-shadow: 0 10px 24px rgba(6, 79, 159, 0.24);
}

.category-count {
  min-width: 34px;
  color: inherit;
  opacity: 0.78;
  font-weight: 950;
  text-align: right;
}

.social-card {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 19px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(225, 48, 108, 0.96), rgba(253, 29, 29, 0.90), rgba(252, 176, 69, 0.92));
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(225, 48, 108, 0.22);
}

.social-card::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -48px;
  width: 130px;
  height: 130px;
  border: 20px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.social-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
}

.social-card .small-label {
  color: rgba(255, 255, 255, 0.82);
}

.social-card h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
  letter-spacing: -0.05em;
}

.social-card p {
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
}

.social-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  justify-content: center;
  width: 100%;
  padding: 13px 14px;
  color: #111827;
  background: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 950;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.content {
  min-width: 0;
}

.content-header {
  margin-bottom: 20px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#stats {
  margin: 9px 0 0;
  color: var(--muted);
  font-weight: 700;
}

#limitSelect {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(6, 27, 66, 0.10);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(6, 79, 159, 0.28);
  box-shadow: 0 20px 44px rgba(6, 27, 66, 0.16);
}

.card:hover::before {
  opacity: 1;
}

.image-button {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(6, 79, 159, 0.08), rgba(245, 196, 79, 0.16)),
    #eef2f7;
}

.card-body {
  padding: 14px;
}

.card-title {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.card-category {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 6px 9px;
  color: var(--blue-dark);
  background: rgba(245, 196, 79, 0.22);
  border: 1px solid rgba(226, 168, 41, 0.24);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 950;
}

.actions {
  display: flex;
  justify-content: center;
  padding: 34px 0 0;
}

#loadMoreButton {
  min-width: 230px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(6, 79, 159, 0.24);
}

#loadMoreButton:hover {
  filter: brightness(1.08);
}

#loadMoreButton:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.empty-state {
  padding: 56px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.image-dialog {
  width: min(930px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--blue-dark);
  color: #fff;
  overflow: hidden;
}

.image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: var(--blue-dark);
}

.image-dialog p {
  margin: 0;
  padding: 15px 19px 19px;
  font-weight: 950;
}

.close-dialog {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue-dark);
  font-size: 1.5rem;
  font-weight: 950;
  line-height: 1;
}

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-brand {
    align-items: flex-start;
  }

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

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

  .category-list {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .brand-mini span {
    max-width: 190px;
    font-size: 0.86rem;
    line-height: 1.05;
  }

  .top-instagram {
    padding: 9px 12px;
    font-size: 0.82rem;
  }

  .hero-inner {
    padding-top: 24px;
  }

  .hero-brand {
    flex-direction: column;
  }

  .hero-logo {
    width: 92px;
    height: 92px;
  }

  h1 {
    font-size: clamp(2rem, 13vw, 3.25rem);
  }

  .hero-panel {
    padding: 12px;
  }

  .instagram-feature {
    padding: 13px;
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #limitSelect {
    width: 100%;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }

  .card-body {
    padding: 11px;
  }

  .card-title {
    font-size: 0.84rem;
  }

  .card-category {
    font-size: 0.68rem;
  }
}
