/* Instagram feed widget (assets/js/instagram.js). All selectors are scoped with .ig-.
   States: [data-state="loading|api|embeds|consent|none"] on .ig-feed. */

.ig-feed { display: block; min-width: 0; }
.ig-icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Grid (api) ---------- */
.ig-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, .4rem + .8vw, 18px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) {
  .ig-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .ig-grid__item:nth-child(n + 9) { display: none; }
}
.ig-grid__item { min-width: 0; margin: 0; }

.ig-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 25%, rgba(176, 141, 87, .22), transparent 60%),
    var(--cream-200);
  box-shadow: 0 1px 2px rgba(0, 16, 39, .08);
  color: var(--cream-50);
  text-decoration: none;
  isolation: isolate;
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.ig-tile--skeleton {
  min-height: 0;
  background: linear-gradient(90deg, #EEE4DB 0%, #F8F2EC 45%, #EEE4DB 90%) 0 0 / 300% 100%;
  box-shadow: none;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.section--navy .ig-tile--skeleton, .section--red .ig-tile--skeleton, .is-dark .ig-tile--skeleton {
  background: linear-gradient(90deg, rgba(244, 229, 222, .06) 0%, rgba(244, 229, 222, .14) 45%, rgba(244, 229, 222, .06) 90%) 0 0 / 300% 100%;
}
.ig-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .45s var(--ease), transform .7s var(--ease);
}
.ig-tile__img.is-loaded { opacity: 1; }
.ig-tile__type {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 10, 26, .42);
  color: #FFFFFF;
  font-size: 15px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.ig-tile__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .6rem;
  padding: clamp(12px, .6rem + .6vw, 20px);
  background: linear-gradient(to top, rgba(0, 10, 26, .94) 0%, rgba(0, 16, 39, .78) 55%, rgba(0, 16, 39, .38) 100%);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.ig-tile__caption {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--cream-50);
  overflow-wrap: anywhere;
}
.ig-tile__caption--empty { font-style: italic; color: rgba(248, 241, 235, .85); }
.ig-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .55rem;
  border-top: 1px solid rgba(216, 191, 149, .35);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--brass-300);
}
.ig-tile__meta .ig-icon { width: 15px; height: 15px; color: var(--cream-50); }
.ig-tile__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 12px;
  background:
    linear-gradient(160deg, rgba(0, 16, 39, .04), rgba(136, 1, 5, .08)),
    var(--cream-100);
  color: var(--navy-800);
  font-size: .8125rem;
  font-weight: 600;
  text-align: center;
}
.ig-tile__placeholder .ig-icon { width: 30px; height: 30px; color: var(--red-700); }

@media (hover: hover) {
  .ig-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
  .ig-tile:hover .ig-tile__overlay { opacity: 1; }
  .ig-tile:hover .ig-tile__img { transform: scale(1.06); }
}
.ig-tile:focus-visible { outline: 2.5px solid var(--focus-ring); outline-offset: 3px; }
.ig-tile:focus-visible .ig-tile__overlay { opacity: 1; }

/* ---------- Follow row ---------- */
.ig-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  margin-top: clamp(22px, 1rem + 1.2vw, 36px);
}
.ig-follow__handle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  color: var(--heading);
  text-decoration: none;
}
.ig-follow__handle .ig-icon { color: var(--red-700); }
.is-dark .ig-follow__handle .ig-icon, .section--navy .ig-follow__handle .ig-icon, .section--red .ig-follow__handle .ig-icon { color: var(--brass-300); }
.ig-follow__handle:hover { color: var(--link); text-decoration: underline; text-underline-offset: .2em; }
.ig-follow__btn .ig-icon { width: 1.2em; height: 1.2em; }

/* ---------- Profile showcase (none / error): text + phone preview ---------- */
.ig-showcase-wrap { container-type: inline-size; }
.ig-showcase {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 1rem + 3vw, 56px);
  align-items: center;
  overflow: hidden;
  padding: clamp(28px, 1rem + 3vw, 60px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 70% 90% at 100% 0%, rgba(136, 1, 5, .7), transparent 62%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(30, 67, 122, .45), transparent 70%),
    linear-gradient(150deg, var(--navy-900), var(--navy-950));
  box-shadow: var(--shadow-lg, var(--shadow));
  color: var(--cream-50);
}
.ig-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--cream-200);
  -webkit-mask: var(--kilim-tile) center / 72px 72px repeat;
  mask: var(--kilim-tile) center / 72px 72px repeat;
  opacity: .05;
}
@container (min-width: 720px) {
  .ig-showcase { grid-template-columns: minmax(0, 1fr) 290px; }
}
.ig-showcase__text { display: flex; flex-direction: column; align-items: flex-start; gap: .85rem; min-width: 0; }
.ig-showcase__text > * { margin: 0; }
.ig-showcase__label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brass-300);
}
.ig-showcase__label .ig-icon { width: 1.15em; height: 1.15em; }
.ig-showcase__handle {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.6rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  overflow-wrap: break-word;
}
.ig-showcase__lead { max-width: 46ch; font-size: clamp(1rem, .95rem + .2vw, 1.1rem); line-height: 1.65; color: rgba(253, 250, 247, .82); }
.ig-showcase__topics { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.ig-showcase__topics li {
  padding: .3rem .8rem;
  border: 1px solid rgba(216, 191, 149, .4);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--brass-300);
}
.ig-showcase__btn { margin-top: .4rem; }
.ig-showcase__btn .ig-icon { width: 1.2em; height: 1.2em; }

/* Phone preview */
.ig-phone {
  justify-self: center;
  width: min(100%, 290px);
  padding: 9px;
  border-radius: 38px;
  background: linear-gradient(160deg, #1B2130, #05070C);
  box-shadow: 0 40px 70px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .1);
  transform: rotate(2.5deg);
  container-type: inline-size;
}
.ig-phone__screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  padding: 10px 10px 0;
  border-radius: 30px;
  background: #FFFFFF;
  color: #14171F;
}
.ig-phone__bar { position: relative; display: grid; justify-items: center; gap: 8px; padding-top: 2px; font-size: .72rem; }
.ig-phone__notch { width: 72px; height: 18px; border-radius: 999px; background: #05070C; }
.ig-phone__head { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.ig-phone__avatar {
  flex: none;
  width: 56px;
  height: 56px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--red-700), var(--brass-500), var(--red-500), var(--navy-700), var(--red-700));
}
.ig-phone__avatar img { display: block; width: 100%; height: 100%; padding: 3px; border-radius: 50%; background: #FFFFFF; object-fit: contain; }
.ig-phone__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.ig-phone__who strong { font-size: .78rem; }
.ig-phone__who span { font-size: .66rem; color: #5B6170; }
.ig-phone__follow {
  display: block;
  margin: 0 4px;
  padding: .42rem;
  border-radius: 8px;
  background: var(--red-700);
  color: #FFFFFF;
  font-size: .74rem;
  font-weight: 700;
  text-align: center;
}
.ig-phone__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 0 -10px; }
.ig-phone__tile { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; background: var(--navy-900); }
.ig-phone__tile img { width: 100%; height: 100%; object-fit: cover; }
.ig-phone__tile--photo img { object-position: 50% 18%; }
.ig-phone__tile--logo { background: var(--cream-100); }
.ig-phone__tile--logo img { width: 78%; height: 78%; object-fit: contain; }
.ig-phone__tile--emblem { background: radial-gradient(circle at 50% 40%, var(--red-700), var(--navy-900) 75%); }
.ig-phone__tile--emblem img { width: 86%; height: 86%; object-fit: contain; }
.ig-phone__tile--kilim { background: var(--red-700); }
.ig-phone__tile--kilim::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--cream-200);
  -webkit-mask: var(--kilim-tile) center / 44px 44px repeat;
  mask: var(--kilim-tile) center / 44px 44px repeat;
  opacity: .5;
}
.ig-phone__tile--word {
  padding: 6px;
  font-family: var(--font-display);
  font-size: clamp(.56rem, 3.7cqi, .82rem);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}
.ig-phone__tile--navy { background: var(--navy-900); color: var(--brass-300); }
.ig-phone__tile--red { background: var(--red-700); color: var(--cream-50); }
.ig-phone__tile--cream { background: var(--cream-200); color: var(--navy-900); font-style: italic; }
.ig-phone__tile--dusk { background: linear-gradient(180deg, var(--red-700), var(--navy-900)); color: var(--cream-50); }
.ig-phone__tile--word small { display: block; margin-top: 2px; font-family: var(--font-body); font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-300); }
@container (max-width: 420px) {
  .ig-phone { width: min(100%, 250px); transform: none; }
  .ig-showcase__handle { font-size: 1.4rem; }
}

.ig-deco {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(136, 1, 5, .55), transparent 70%),
    linear-gradient(160deg, var(--navy-900), var(--navy-950));
}
@media (min-width: 820px) {
  .ig-deco { display: grid; align-content: center; }
}
.ig-deco__cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(244, 229, 222, .07);
  border: 1px solid rgba(244, 229, 222, .12);
}
.ig-deco__cell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: var(--cream-200);
  -webkit-mask: var(--kilim-tile) center / 64px 64px repeat;
  mask: var(--kilim-tile) center / 64px 64px repeat;
  opacity: .14;
}
.ig-deco__cell--1 { background: rgba(136, 1, 5, .45); border-color: rgba(196, 42, 47, .45); }
.ig-deco__cell--2 { background: rgba(176, 141, 87, .2); border-color: rgba(216, 191, 149, .3); }
.ig-deco__cell:nth-child(6) {
  background: rgba(244, 229, 222, .1);
}
.ig-deco__cell:nth-child(6)::after {
  content: "";
  position: absolute;
  inset: 26%;
  background-color: var(--cream-50);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Ccircle cx='17.4' cy='6.6' r='1' fill='black' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Ccircle cx='17.4' cy='6.6' r='1' fill='black' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Consent card (manual without consent) ---------- */
.ig-consent {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--cream-300);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(176, 141, 87, .12), transparent 70%),
    var(--surface, #FFFFFF);
  box-shadow: var(--shadow);
  color: var(--ink-900);
}
@media (min-width: 820px) {
  .ig-consent { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); }
}
.ig-consent__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: clamp(24px, 1rem + 2.5vw, 44px);
}
@media (min-width: 640px) {
  .ig-consent__main { grid-template-columns: auto minmax(0, 1fr); gap: 28px; }
}
.ig-consent__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--red-700), var(--red-800));
  color: var(--cream-50);
  font-size: 30px;
  box-shadow: 0 10px 22px -12px rgba(136, 1, 5, .8);
}
.ig-consent__body { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; min-width: 0; }
.ig-consent__body > * { margin: 0; }
.ig-consent__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy-900);
}
.ig-consent__text { font-size: 1rem; line-height: 1.6; color: var(--ink-900); }
.ig-consent__note {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  max-width: 62ch;
  font-size: .85rem;
  line-height: 1.55;
  color: #4A5160;
}
.ig-consent__note .ig-icon { margin-top: .15em; color: var(--brass-700); }
.ig-consent__note a { color: var(--red-700); font-weight: 600; }
.ig-consent__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: .4rem !important; }
.ig-consent__actions .btn--outline { --btn-fg: var(--navy-900); --btn-bd: rgba(0, 16, 39, .3); --btn-bg-hover: var(--navy-900); --btn-fg-hover: var(--cream-50); --btn-bd-hover: var(--navy-900); }
@media (max-width: 479.98px) {
  .ig-consent__actions { width: 100%; }
  .ig-consent__actions .btn { flex: 1 1 100%; }
}
.ig-consent__link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--red-700);
  text-underline-offset: .2em;
}
.ig-consent__link:hover { color: var(--navy-900); }

/* ---------- Official embeds (manual with consent) ---------- */
.ig-embeds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(16px, 1rem + .8vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ig-embeds__item {
  flex: 1 1 326px;
  min-width: 0;
  max-width: 420px;
  margin: 0;
}
.ig-embeds .instagram-media,
.ig-embeds iframe.instagram-media {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
}
.ig-embeds blockquote.instagram-media {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 24px;
  border: 1px solid var(--cream-300);
  background: var(--surface, #FFFFFF);
}
.ig-embeds__fallback {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  color: var(--navy-900);
  text-align: center;
  text-decoration: none;
}
.ig-embeds__fallback .ig-icon { width: 36px; height: 36px; color: var(--red-700); }
.ig-embeds__fallback:hover span { text-decoration: underline; text-underline-offset: .2em; }
.ig-embeds__error {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  background: #FDF6E9;
  border: 1px solid #F0D5A8;
  color: var(--ink-900);
  font-size: var(--fs-sm);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .ig-tile, .ig-tile__img { transition: none !important; }
  .ig-tile:hover, .ig-tile:hover .ig-tile__img { transform: none !important; }
}
