/* ═══════════════════════════════════════════════════════════════
   Sidetake — the resource library: shared parts. A warm paper page
   laid out like the magazines Hemang chose (The Lab Mag, Vogue
   India, Harper's Bazaar India, Desi Art Mag): an announcement strip,
   the official wordmark centred between menu/search and Get the app,
   tracked category links under a hairline, a slim bar once you
   scroll, photo-led cards, section titles on long rules, "Stay
   curious" and a dark four-column footer.
   Colour stays Sidetake's (ink, emerald, sage) and type stays Geist +
   Inter. The home page adds library-home.css; a piece adds
   library-article.css.
   ═══════════════════════════════════════════════════════════════ */

body.libp {
  --paper: #fbfaf6;
  --paper-2: #f1eee6;
  --ink-text: #0a100e;
  --ink-soft: #3d4743;
  --ink-mute: #69716d;
  --accent: #0d6446;
  --accent-tint: #e4f2ec;
  --hair: #e2ddd2;
  --side: clamp(16px, 5.9vw, 85px);
  --gap-block: clamp(3rem, 6vw, 5.5rem);
  --track: 0.16em;
  background: var(--paper);
  color: var(--ink-text);
}
.libp :focus-visible {
  outline-color: var(--accent);
}

.mag {
  width: min(1270px, calc(100% - var(--side) * 2));
  margin-inline: auto;
}

/* the official wordmark lives in site.css (.wordmark); here only sizes */

/* ══════════ announcement strip ══════════ */

.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 1rem;
  padding: 0.6rem var(--side);
  background: var(--accent);
  color: var(--text);
  font-size: 0.8rem;
  text-align: center;
}
.strip__link {
  font-weight: 700;
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.strip__link:hover {
  color: var(--text);
}

/* ══════════ masthead ══════════ */

.mhead {
  position: relative;
  z-index: 60;
  background: var(--paper);
}
.mhead__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: clamp(78px, 7.4vw, 112px);
  padding-inline: clamp(10px, 3vw, 44px);
}
.mhead__start,
.mhead__end,
.minibar__end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.mhead__end,
.minibar__end {
  justify-self: end;
}
.mhead__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-text);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.mhead__icon:hover {
  background: var(--paper-2);
}
.mhead__icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.9;
}
.mhead__ig svg {
  width: 20px;
  height: 20px;
}
.mhead__menu {
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding-inline: 11px;
}
.mhead__menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.mhead__menu.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mhead__menu.is-open span:nth-child(2) {
  opacity: 0;
}
.mhead__menu.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
.mhead__logo,
.minibar__logo,
.mfoot__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink-text);
}
.mhead__logo .wordmark {
  height: clamp(28px, 1.2rem + 1.6vw, 50px);
}
.mhead__sub {
  padding-left: 0.85rem;
  border-left: 2px solid currentColor;
  font-size: clamp(0.62rem, 0.55rem + 0.3vw, 0.86rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.mhead__app {
  padding: 0.66rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.mhead__app:hover {
  background: var(--ink-text);
  transform: translateY(-1px);
}

/* Vogue's tracked links under a hairline; Harper's underline marks where you are */
.cnav {
  border-block: 1px solid var(--hair);
}
.cnav__track {
  display: flex;
  justify-content: center;
  gap: clamp(1.1rem, 2.6vw, 2.6rem);
  overflow-x: auto;
  padding-inline: var(--side);
  scrollbar-width: none;
}
.cnav__track::-webkit-scrollbar {
  display: none;
}
.cnav__link {
  position: relative;
  flex: none;
  padding: 0.95rem 0 0.9rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.cnav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--dur) var(--ease);
}
.cnav__link:hover,
.cnav__link[aria-current='page'] {
  color: var(--accent);
}
.cnav__link:hover::after,
.cnav__link[aria-current='page']::after {
  transform: scaleX(1);
}

/* the slim bar that takes over once the masthead scrolls away */
.minibar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 75;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 60px;
  padding-inline: clamp(8px, 3vw, 44px);
  border-bottom: 1px solid var(--hair);
  background: rgba(251, 250, 246, 0.95);
  backdrop-filter: blur(12px);
  transform: translateY(-101%);
  transition: transform 380ms var(--ease-out);
}
.minibar.is-on {
  transform: none;
}
.minibar__logo {
  gap: 0.6rem;
}
.minibar__logo .wordmark {
  height: 24px;
}
.minibar__logo .mhead__sub {
  font-size: 0.6rem;
  padding-left: 0.6rem;
}
.minibar .mhead__app {
  padding: 0.55rem 0.9rem;
  font-size: 0.66rem;
}

/* the menu opens under the slim bar */
.libp .drawer {
  top: 66px;
  max-height: calc(100svh - 76px);
  padding-top: 1.4rem;
  overflow-y: auto;
  z-index: 80;
  color: var(--text);
}
.drawer__site {
  width: fit-content;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sage);
}

/* ══════════ search ══════════ */

.search {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow-y: auto;
  background: rgba(251, 250, 246, 0.985);
  animation: fade-in-soft 260ms var(--ease-out);
}
.search[hidden] {
  display: none;
}
@keyframes fade-in-soft {
  from {
    opacity: 0;
  }
}
.search__panel {
  position: relative;
  width: min(860px, calc(100% - var(--side) * 2));
  margin: 0 auto;
  padding: clamp(4.5rem, 12vh, 8rem) 0 4rem;
}
.search__close {
  position: fixed;
  top: 14px;
  right: clamp(12px, 3vw, 44px);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid var(--ink-text);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-text);
  cursor: pointer;
}
.search__close svg {
  width: 22px;
  height: 22px;
}
.search__close:hover {
  background: var(--ink-text);
  color: var(--paper);
}
.search__label {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}
.search__input {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.6rem 0;
  border: 0;
  border-bottom: 2px solid var(--ink-text);
  border-radius: 0;
  background: none;
  color: var(--ink-text);
  font: 500 clamp(1.2rem, 1rem + 1vw, 1.7rem) var(--font-body);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search__input:focus {
  border-bottom-color: var(--accent);
}
.search__hint {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-mute);
}
.search__results {
  display: grid;
  margin-top: 1.25rem;
}
.search__hit {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 1.1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--hair);
}
.search__hit img {
  width: 132px;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}
.search__cat {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--accent);
}
.search__title {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}
.search__why {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.86rem;
  color: var(--ink-mute);
}
.search__hit:hover .search__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.search__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
}
.search__topics-label {
  width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--ink-mute);
}
.search__topic {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink-text);
  border-radius: 999px;
  font-size: 0.85rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.search__topic:hover {
  background: var(--ink-text);
  color: var(--paper);
}

/* ══════════ shared type ══════════ */

.kicker {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--accent);
}
.kicker a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.byline {
  margin-top: 0.7rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.byline__dot {
  margin-inline: 0.35rem;
}

/* Harper's section titles: the word, then a long rule */
.sec-head {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.4rem);
  margin-bottom: clamp(1.25rem, 2.6vw, 2rem);
}
.sec-head__t {
  flex: 0 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1rem + 1.2vw, 2.1rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.sec-head__t a:hover {
  color: var(--accent);
}
.sec-head__rule {
  flex: 1;
  height: 1px;
  background: var(--ink-text);
}
.sec-head__more {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: gap var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sec-head__more svg {
  width: 15px;
  height: 15px;
}
.sec-head__more:hover {
  gap: 0.65rem;
  color: var(--accent);
}
.block {
  margin-top: var(--gap-block);
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  background: var(--ink-text);
  color: var(--paper);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), gap var(--dur) var(--ease);
}
.btn-pill svg {
  width: 16px;
  height: 16px;
}
.btn-pill:hover {
  gap: 0.75rem;
  background: var(--accent);
}
.btn-pill--light {
  background: var(--paper);
  color: var(--ink-text);
}
.btn-pill--light:hover {
  background: var(--sage);
  color: var(--ink-text);
}

/* ══════════ cards ══════════ */

.grid3,
.grid4 {
  display: grid;
  gap: clamp(2.2rem, 4vw, 3.2rem) clamp(14px, 1.6vw, 24px);
}
.grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
  min-width: 0;
}
.card__img {
  display: block;
  overflow: hidden;
  background: var(--paper-2);
}
.card__img img {
  display: block;
  width: 100%;
  height: auto;
  transition: scale 900ms var(--ease-out);
}
.card:hover .card__img img,
.split__main:hover .card__img img {
  scale: 1.04;
}
.card .kicker {
  margin-top: 1.05rem;
}
.card__title {
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.22rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.card__title a,
.rcard__title a {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size 500ms var(--ease-out);
}
.card:hover .card__title a,
.rcard:hover .rcard__title a {
  background-size: 100% 1px;
}

.rcard {
  display: grid;
  grid-template-columns: clamp(120px, 12vw, 180px) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--hair);
}
.rcard:first-child {
  padding-top: 0;
}
.rcard__img {
  display: block;
  overflow: hidden;
}
.rcard__img img {
  display: block;
  width: 100%;
  height: auto;
}
.rcard__title {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}
.rcard__meta {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--ink-mute);
}

/* ══════════ "Stay curious" ══════════ */

.stay {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: var(--gap-block);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 4rem);
  background: var(--paper-2);
  text-align: center;
}
.stay__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.4rem + 3vw, 3.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}
.stay__sub {
  max-width: 52ch;
  color: var(--ink-soft);
}
.stay .stores {
  margin-top: 0.5rem;
}
.stay .store {
  border-color: var(--ink-text);
  background: var(--ink-text);
  color: var(--text);
  backdrop-filter: none;
}
.stay .store:hover {
  border-color: var(--accent);
  background: var(--accent);
}
.stay__ig {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}
.stay__ig svg {
  width: 18px;
  height: 18px;
}
.stay__ig:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ══════════ footer ══════════ */

.mfoot {
  margin-top: var(--gap-block);
  padding: clamp(2.6rem, 5vw, 4rem) var(--side) 1.6rem;
  background: var(--ink-text);
  color: var(--text);
}
.mfoot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 4vw, 4rem);
  max-width: 1270px;
  margin-inline: auto;
}
.mfoot__logo {
  color: var(--text);
}
.mfoot__logo .wordmark {
  height: 34px;
}
.mfoot__logo .mhead__sub {
  color: var(--sage);
}
.mfoot__about p {
  max-width: 40ch;
  margin-top: 1.1rem;
  font-size: 0.92rem;
  color: rgba(244, 250, 247, 0.72);
}
.mfoot__social {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
}
.mfoot__social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.mfoot__social a:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--ink-text);
}
.mfoot__social svg {
  width: 18px;
  height: 18px;
}
.mfoot__col {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}
.mfoot__h {
  margin-bottom: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--sage);
}
.mfoot__col a {
  width: fit-content;
  font-size: 0.92rem;
  color: rgba(244, 250, 247, 0.82);
  transition: color var(--dur) var(--ease), translate var(--dur) var(--ease);
}
.mfoot__col a:hover {
  color: var(--sage);
  translate: 3px 0;
}
.mfoot__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  max-width: 1270px;
  margin: clamp(2.2rem, 4vw, 3.2rem) auto 0;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 250, 247, 0.55);
}
.mfoot__bar a:hover {
  color: var(--sage);
}

.totop {
  position: fixed;
  right: clamp(12px, 3vw, 40px);
  bottom: clamp(12px, 3vw, 40px);
  z-index: 50;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-text);
  box-shadow: 0 6px 22px -6px rgba(10, 16, 14, 0.35);
  opacity: 0;
  pointer-events: none;
  translate: 0 10px;
  transition: opacity var(--dur) var(--ease), translate var(--dur) var(--ease), background var(--dur) var(--ease);
}
.totop.is-on {
  opacity: 1;
  pointer-events: auto;
  translate: 0 0;
}
.totop:hover {
  background: var(--ink-text);
  color: var(--paper);
}
.totop svg {
  width: 20px;
  height: 20px;
}
.empty__note {
  margin-top: var(--gap-block);
  color: var(--ink-mute);
}

/* ══════════ responsive ══════════ */

@media (max-width: 1100px) {
  .grid4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mfoot__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mfoot__about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .grid3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cnav__track {
    justify-content: flex-start;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
}

@media (max-width: 700px) {
  /* Vogue's stacked lockup ("VOGUE / INDIA"): the label under the wordmark */
  .mhead__logo {
    flex-direction: column;
    gap: 5px;
  }
  .mhead__logo .wordmark {
    height: 26px;
  }
  .mhead__logo .mhead__sub {
    padding-left: 0.3em;
    border-left: 0;
    font-size: 0.56rem;
    letter-spacing: 0.34em;
  }
  .strip {
    font-size: 0.74rem;
  }
  .strip__txt {
    display: none;
  }
  .mhead__app {
    display: none;
  }
  .mhead__sub {
    letter-spacing: 0.18em;
  }
  .grid3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid4 {
    gap: 2rem 12px;
  }
  .card--port .card__title {
    font-size: 0.98rem;
  }
  .card--port .byline {
    display: none;
  }
  .search__hit {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .search__hit img {
    width: 96px;
  }
  .mfoot__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .sec-head__rule {
    min-width: 12px;
  }
  .sec-head__more {
    font-size: 0.64rem;
  }
  .mhead__icon {
    width: 40px;
    height: 40px;
  }
  .minibar .mhead__app,
  .minibar__logo .mhead__sub {
    display: none;
  }
  .mfoot__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card__img img,
  .minibar {
    transition: none;
  }
}
