/* ==========================================================================
   IRIS Photography & Film — Design System
   Direction: the darkroom + the Bengali wedding. Portfolio as contact sheet,
   negatives on a light table. Section dividers borrow from alpona line-work.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #15120F;
  --ink-soft: #2A241E;
  --paper: #F1E9DC;
  --paper-dim: #E6DBC8;
  --amber: #E8763C;
  --sindoor: #7A1F2B;
  --marigold: #D9A441;
  --ash: #8A8477;

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max-width: 1240px;
  --edge: 1px solid rgba(21, 18, 15, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }

/* -------------------------------- Frame label utility -------------------- */
.frame-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ash);
}

/* -------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(241, 233, 220, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: var(--edge);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Placeholder until a real logo file exists at images/logo.png — the
   onerror handler on the <img> hides it and reveals the text fallback,
   so nothing looks broken before the real asset is added. Once
   images/logo.png exists, it's used automatically, no code change needed. */
.logo-img { height: 44px; width: auto; display: block; }
.footer-logo-img { height: 40px; width: auto; display: block; margin-bottom: 10px; }

.logo::before {
  content: '● ';
  color: var(--amber);
  font-size: 0.6em;
  vertical-align: middle;
}

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2vw, 32px); flex-wrap: nowrap; }

.nav-links a:not(.btn) {
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 0.9vw, 0.78rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a.btn { white-space: nowrap; flex-shrink: 0; }

.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--sindoor);
  transition: width 0.25s;
}

.nav-links a:not(.btn):hover::after,
.nav-links a.active::after { width: 100%; }

.nav-links a:hover, .nav-links a.active { color: var(--sindoor); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
}

/* -------------------------------- Buttons ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--sindoor); border-color: var(--sindoor); transform: translateY(-1px); }
.nav-links a.btn-primary { color: var(--paper) !important; }
.nav-links a.btn-primary:hover { color: var(--paper) !important; }

.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn:disabled, .btn:disabled:hover {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
  color: var(--ash);
  border-color: var(--ash);
  transform: none;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: var(--edge);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  margin-right: 4px;
}
.icon-btn:hover { background: var(--ink); color: var(--paper); }
.icon-btn-danger { color: var(--sindoor); border-color: var(--sindoor); }
.icon-btn-danger:hover { background: var(--sindoor); color: var(--paper); }

.view-modal-box {
  max-width: 900px;
  max-height: 90vh;
}
.view-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}
details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s;
}
details[open] > summary::before {
  transform: rotate(90deg);
}
@media (max-width: 720px) {
  .view-modal-box { max-width: 100%; max-height: 95vh; }
  .view-modal-grid { grid-template-columns: 1fr; }
}

/* -------------------------------- Hero -------------------------------------
   Asymmetric: headline block left, filmstrip light-table right.
   ---------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  min-height: 86vh;
  padding: 64px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sindoor);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: '';
  width: 28px; height: 1px;
  background: var(--sindoor);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--sindoor);
}

.hero p {
  color: var(--ink-soft);
  max-width: 460px;
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.hero-actions { display: flex; gap: 16px; }

/* Light-table filmstrip (signature element) */
.filmstrip {
  position: relative;
  background: var(--ink);
  border-radius: 4px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 30px 60px -20px rgba(21, 18, 15, 0.4);
}

.filmstrip::before, .filmstrip::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 16px;
  background-image: radial-gradient(circle, var(--paper) 3px, transparent 3px);
  background-size: 20px 16px;
  background-repeat: repeat-x;
  opacity: 0.5;
}
.filmstrip::before { top: 4px; }
.filmstrip::after { bottom: 4px; }

.filmstrip-frame {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--ink-soft);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(241, 233, 220, 0.08);
}

.filmstrip-frame .frame-number {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--amber);
  writing-mode: vertical-rl;
  text-align: center;
  padding: 12px 0;
  letter-spacing: 0.05em;
}

.filmstrip-frame img {
  aspect-ratio: 4/3;
  object-fit: cover;
  filter: sepia(0.15) contrast(1.05);
}

/* -------------------------------- Alpona divider ---------------------------
   Hand-drawn-style rule between sections, echoing rice-paste wedding
   floor patterns without being literal/decorative filler.
   ---------------------------------------------------------------------- */
.alpona-divider {
  height: 34px;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0 32px;
  opacity: 0.55;
}

.alpona-divider svg { width: 100%; height: 100%; }
.alpona-divider path { stroke: var(--sindoor); }

/* -------------------------------- Sections ---------------------------------- */
section { padding: 88px 32px; }
.section-alt { background: var(--paper-dim); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  max-width: var(--max-width);
  margin: 0 auto 48px;
  gap: 24px;
  flex-wrap: wrap;
}

.section-head .frame-label { margin-bottom: 10px; display: block; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--ink-soft);
  max-width: 380px;
  font-size: 0.95rem;
}

/* -------------------------------- Grid / cards ------------------------------ */
.grid { display: grid; gap: 28px; max-width: var(--max-width); margin: 0 auto; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: transparent;
  border-top: var(--edge);
  padding-top: 20px;
  transition: transform 0.25s;
}

.card:hover { transform: translateY(-3px); }

.card img {
  aspect-ratio: 4/3;
  object-fit: cover;
  margin-bottom: 16px;
  filter: grayscale(0.15);
  transition: filter 0.3s;
}

.card:hover img { filter: grayscale(0); }

.card-body h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.card-body p { color: var(--ink-soft); font-size: 0.9rem; }
.card-price { font-family: var(--font-mono); font-size: 0.85rem; color: var(--sindoor); margin-top: 10px; }

/* -------------------------------- Gallery ------------------------------------ */
.gallery-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 20px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  color: var(--ink);
}

.filter-btn.active, .filter-btn:hover { background: var(--ink); color: var(--paper); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-item { position: relative; cursor: pointer; overflow: hidden; background: var(--ink); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; transition: transform 0.4s, opacity 0.3s; opacity: 0.94; }
.gallery-item:hover img { transform: scale(1.04); opacity: 1; }

/* -------------------------------- Forms ------------------------------------- */
.form-group { margin-bottom: 22px; }

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 4px;
  border: none;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: auto;
  padding: 0;
  border-bottom: none;
  flex-shrink: 0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--sindoor);
}

.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.required-star { color: var(--sindoor); }

.ceremony-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.ceremony-card {
  border: var(--edge);
  border-radius: 4px;
  padding: 14px;
}
.ceremony-card label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ash);
}
.ceremony-card input {
  width: 100%;
  padding: 8px 4px;
  border: none;
  border-bottom: 1px solid var(--color-border, #ccc);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .ceremony-grid { grid-template-columns: 1fr; }
}

/* -------------------------------- Testimonials ------------------------------- */
.testimonial-card {
  background: transparent;
  border-top: var(--edge);
  padding-top: 24px;
}

.stars { color: var(--marigold); margin-bottom: 14px; letter-spacing: 2px; }

/* -------------------------------- Language toggle switch --------------------- */
.lang-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.lang-switch input { display: none; }
.lang-switch .track {
  width: 46px; height: 24px; background: var(--ink); border-radius: 12px; position: relative; transition: background 0.2s;
}
.lang-switch .thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--amber); transition: transform 0.2s;
}
.lang-switch input:checked + .track .thumb { transform: translateX(22px); }
.lang-switch input:checked + .track { background: var(--sindoor); }
.lang-switch .label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* -------------------------------- Calendar day cell -------------------------- */
#calendar-container { max-width: 880px; margin: 0 auto; }

.calendar-grid { font-size: 1rem; }

.cal-cell {
  aspect-ratio: 1;
  max-height: 180px;
  border: var(--edge);
  position: relative;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
}

.cal-cell.out-of-range { opacity: 0.32; cursor: default; }
.cal-cell.adjacent-month { background: var(--paper-dim); opacity: 0.5; }

.cal-cell .cal-bars {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  align-items: stretch; gap: 3px; z-index: 0; pointer-events: none;
}
.cal-cell .cal-bars > div { width: 100%; height: 20px; border-radius: 2px; pointer-events: auto; cursor: pointer; }

.cal-cell .cal-content { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; height: 100%; pointer-events: none; }
.cal-cell .cal-content > * { pointer-events: auto; }

.cal-dots { display: flex; gap: 4px; }
.cal-dots .cal-dot-col { display: flex; flex-direction: column; gap: 3px; }
.cal-dot { cursor: pointer; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15)); }
.cal-dot svg { display: block; }

.cal-plus-overlay {
  position: absolute; right: 0; bottom: 0; width: 33.33%; height: 33.33%;
  display: none; align-items: center; justify-content: center;
  background: rgba(21, 18, 15, 0.55); color: var(--paper); font-size: 1.3rem; font-weight: 300;
  cursor: pointer; z-index: 1; pointer-events: none; border-radius: 4px 0 0 0;
}
.cal-cell:hover .cal-plus-overlay.enabled { display: flex; }

.cal-cell.is-holiday { background: rgba(74, 143, 165, 0.1); }
.cal-holiday-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--marigold); color: var(--ink);
  font-size: 0.62rem; font-style: normal; cursor: pointer; flex-shrink: 0; pointer-events: auto;
}

/* Sunday (col 1) and Saturday (col 7) get distinct tints from weekdays and
   from each other — the grid's header row also occupies 7 columns, so the
   nth-child math stays aligned for every subsequent row. */
.calendar-grid > .cal-cell:nth-child(7n+1) { background: rgba(122, 31, 43, 0.05); }
.calendar-grid > .cal-cell:nth-child(7n+1).adjacent-month { background: rgba(122, 31, 43, 0.03); }
.calendar-grid > .cal-cell:nth-child(7n) { background: rgba(217, 164, 65, 0.12); }
.calendar-grid > .cal-cell:nth-child(7n).adjacent-month { background: rgba(217, 164, 65, 0.06); }

/* -------------------------------- Footer --------------------------------------- */
.site-footer { background: var(--ink); color: var(--paper-dim); padding: 64px 32px 28px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto 32px;
}

.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
}

.footer-grid a { color: #C9C2B4; display: block; margin-bottom: 10px; font-size: 0.9rem; }
.footer-grid a:hover { color: var(--paper); }

.footer-bottom {
  text-align: center;
  padding-top: 28px;
  border-top: 1px solid rgba(241,233,220,0.12);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #7A7365;
}

/* -------------------------------- Admin ----------------------------------------- */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px;
  background: var(--ink);
  color: var(--paper);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  transition: width 0.15s ease;
  flex-shrink: 0;
}
.admin-sidebar h2 { padding: 0 24px 24px; font-family: var(--font-display); font-size: 1.2rem; }
.admin-sidebar .sidebar-title { padding: 0 0 0 24px; margin: 0; font-family: var(--font-display); font-size: 1.2rem; }
#sidebar-collapse-btn { margin-right: 16px; }

.sidebar-nav { flex: 1; overflow-y: auto; }
.sidebar-footer { padding: 16px 24px 0; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 12px; }

.admin-sidebar a, .admin-sidebar button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: #B9B2A4;
}
.nav-icon { width: 18px; flex-shrink: 0; text-align: center; }

.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--sindoor); color: #fff; }

/* Collapsed (icon-only) mode */
.admin-sidebar.collapsed { width: 64px; }
.admin-sidebar.collapsed .sidebar-title,
.admin-sidebar.collapsed .nav-label { display: none; }
.admin-sidebar.collapsed a, .admin-sidebar.collapsed button { justify-content: center; padding: 12px 8px; }
.admin-sidebar.collapsed #sidebar-collapse-btn { margin: 0 auto; }

.admin-main { flex: 1; padding: 36px; background: var(--paper-dim); }

.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-topbar h2 { font-family: var(--font-display); font-size: 1.5rem; }

.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kanban-column { background: var(--paper); border-radius: 4px; padding: 18px; min-height: 400px; }
.kanban-column h3 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 18px; padding-bottom: 10px; border-bottom: var(--edge); }

.kanban-card { background: var(--paper-dim); border: var(--edge); border-radius: 3px; padding: 14px; margin-bottom: 12px; cursor: grab; }
.kanban-card.sla-breach { border-left: 3px solid var(--sindoor); }

/* display:block + overflow-x:auto lets a wide table (the Bookings table
   has 14 columns) scroll horizontally within itself on narrower effective
   viewports, instead of either overflowing the whole page or squishing
   illegibly. thead/tbody keep their normal table-part display values by
   default, so the internal column layout still renders correctly — this
   is a standard lightweight fix that doesn't require wrapping every
   table in admin.js with an extra container div. */
table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; background: var(--paper); -webkit-overflow-scrolling: touch; }
table th, table td { padding: 14px 18px; text-align: left; border-bottom: var(--edge); font-size: 0.88rem; white-space: nowrap; }
table th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; background: var(--paper-dim); }

.login-box { max-width: 380px; margin: 120px auto; background: var(--paper); padding: 44px; border: var(--edge); }
.login-box h2 { font-family: var(--font-display); }

.badge { display: inline-block; padding: 4px 10px; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-soft { background: #F2E3C8; color: #8A5A1E; }
.badge-hard { background: #DDEBDD; color: #2E6B3E; }
.badge-rejected { background: #F1DCDC; color: var(--sindoor); }
.badge-payment_pending { background: #FCE8D5; color: #B5651D; }
.badge-delivery_pending { background: #FCE8D5; color: #B5651D; }
.badge-overdue { background: #F1DCDC; color: var(--sindoor); }
.badge-inquiry { background: #F2E3C8; color: #8A5A1E; }
.badge-confirmed { background: #DDEBDD; color: #2E6B3E; }
.badge-finalized { background: #D9EAF2; color: #2A6A8A; }
.badge-hold { background: #EEE0F2; color: #7A3D8A; }
.badge-done { background: #E4E4E4; color: #555555; }

/* -------------------------------- Responsive --------------------------------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 40px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
}

/* Nav switches to hamburger earlier than the general 640px breakpoint
   below — with 8 links + a button, it needs the extra room sooner,
   independent of when grids/forms/admin start reflowing. */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

@media (max-width: 640px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
