/*
  styles.css — Danish Models International
  Single source of truth. models.css is now empty — all rules live here.

  Sections:
    1.  Variables & reset
    2.  Layout: container, header, nav
    3.  Bureau name
    4.  Dropdown (Contact)
    5.  Hero
    6.  Buttons
    7.  Grid & Cards  (sharp edges, hover description overlay)
    8.  Profile & gallery
    9.  Forms & flash
   10.  Measurements table
   11.  About
   11b. Admin utilities
   12.  Intro overlay & back-to-top
   13.  Responsive
   14.  Reduced-motion
   15.  Crop uploader
   16.  Image ordering (edit model)
*/

/* ─── 1. Variables & reset ─────────────────────────────────────────────── */
:root {
  --max-w:        1200px;
  --accent:       #111;
  --bg:           #efefef;
  --muted:        #8f8f8f;
  --panel:        #ffffff;
  --card-height:  420px;   /* model card image height */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.45;
  color: var(--accent);
  background: var(--bg);
}

/* ─── 2. Layout ─────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem;
}

.site-header {
  background: transparent;
  padding: 1.25rem 0;
}
.site-header .container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

/* ─── 3. Bureau name ─────────────────────────────────────────────────────── */
/* Logo sits top-right, aligned with the nav on the left */
.nav-wrap {
  flex: 0 0 auto;
}
.bureau-name {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: #111;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
  padding-top: .35rem;
  cursor: pointer;
}
.bureau-name:hover { color: #000; text-decoration: none; }

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.main-nav a {
  color: var(--accent);
  text-decoration: none;
  padding: .25rem .5rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .9rem;
}
.main-nav a:hover { color: #000; }

/* ─── 4. Dropdown ───────────────────────────────────────────────────────── */
.main-nav .has-dropdown { position: relative; }
.main-nav .has-dropdown > a {
  position: relative;
  padding: .35rem .6rem;
  background: transparent;
  border-radius: 0;
}
.main-nav .has-dropdown > a .chev {
  margin-left: .4rem;
  display: inline-block;
  font-size: .85rem;
  transform-origin: center;
  transition: transform .18s ease;
}
.main-nav .has-dropdown.open > a .chev { transform: rotate(180deg); }
.main-nav .has-dropdown > a:focus,
.main-nav .has-dropdown > a:hover  { background: transparent; color: var(--accent); outline: none; }
.main-nav .has-dropdown > a:focus-visible { outline: 2px dotted var(--muted); outline-offset: 3px; }

.main-nav .has-dropdown .dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  background: var(--panel);
  border: 1px solid #e6e6e6;
  padding: .35rem 0;
  min-width: 200px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  z-index: 50;
  /* sharp edges */
  border-radius: 0;
}
.main-nav .has-dropdown .dropdown li  { margin: 0; padding: 0; }
.main-nav .has-dropdown .dropdown a   { display: block; padding: .6rem .9rem; color: var(--accent); text-transform: none; }
.main-nav .has-dropdown.open .dropdown { display: block; }

/* ─── 5. Hero ───────────────────────────────────────────────────────────── */
.hero { padding: 3.5rem 0; text-align: center; }
.hero h2 { font-family: 'Georgia', serif; font-size: 2.4rem; margin: 0 0 .5rem; }
.hero p   { color: var(--muted); margin: 0 0 1rem; }

/* ─── 6. Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .6rem 1rem;
  background: #111;
  color: #fff;
  text-decoration: none;
  border-radius: 0;           /* sharp */
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}
.btn:hover { background: #333; }
.btn-secondary       { background: #666; }
.btn-secondary:hover { background: #444; }
.btn-danger          { background: #b11; }
.btn-danger:hover    { background: #d11; }

/* ─── 7. Grid & Cards ───────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.card {
  background: var(--panel);
  padding: 0;
  border-radius: 0;           /* sharp — no round edges */
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(20,20,20,0.05);
  position: relative;
}

/* Image with taller height */
.card img {
  width: 100%;
  height: var(--card-height);
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(95%);
  transition: filter .35s ease, transform .4s ease;
}
.card .card-link { display: block; position: relative; }

/*
  Hover description overlay — shows name, city, age on hover.
  The data is injected via data-* attributes on .card-link (see roster.html).
*/
.card-link::after {
  content: attr(data-meta);
  white-space: pre;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.18) 35%, rgba(0,0,0,0) 70%);
  color: #fff;
  font-family: 'Georgia', serif;
  font-size: .9rem;
  letter-spacing: .04em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .28s ease, transform .28s ease;
  pointer-events: none;
  z-index: 3;
}
.card:hover .card-link::after,
.card:focus-within .card-link::after {
  opacity: 1;
  transform: translateY(0);
}

/* Always-visible name, bottom-centered over the image */
.card-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.18) 35%, rgba(0,0,0,0) 70%);
  color: #fff;
  font-family: 'Georgia', serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.15;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: 2;
}
/* On hover the big name fades out; the small name+city overlay takes over */
.card:hover .card-name,
.card:focus-within .card-name {
  opacity: 0;
}

/* Keyboard focus ring */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: box-shadow .18s ease, opacity .18s ease;
  opacity: 0;
}
.card:focus-within::after {
  opacity: 1;
  box-shadow: inset 0 0 0 3px rgba(17,17,17,0.25);
}
.card-link:focus { outline: none; }

/* Color reveal on hover/focus */
.card:hover img,
.card:focus-within img { filter: none; transform: scale(1.03); }

.card .card-body { padding: 1rem; }
.meta { color: var(--muted); font-size: .95rem; }

/* ─── 8. Profile & gallery ──────────────────────────────────────────────── */
/* Two columns: photos on the left, info (name, details, book) on the right */
.profile-columns {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-top: 1rem;
}
.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;   /* don't stretch children (e.g. the Book button) to full width */
}
.profile-info > h1 { margin: 0; }

/* Horizontal scrollable photo gallery */
.profile-gallery {
  position: relative;
  width: 100%;
}
.gallery-scroll {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: .5rem;
}
.gallery-scroll::-webkit-scrollbar { height: 6px; }
.gallery-scroll::-webkit-scrollbar-thumb { background: #d8d4cf; }
.gallery-photo {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: min(360px, 88%);
  height: 480px;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(95%);
  transition: filter .35s ease;
}
.gallery-photo:hover { filter: none; }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.88);
  color: #111;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .18s ease;
}
.gallery-arrow:hover { background: #fff; }
.gallery-arrow-prev { left: .5rem; }
.gallery-arrow-next { right: .5rem; }

/* Book button: sized to its text, not stretched full-width */
.btn-book { margin-top: 1.25rem; padding: .65rem 1.75rem; }

/* ─── 9. Forms & flash ─────────────────────────────────────────────────── */
.booking-label {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: .75rem;
}
.booking-label strong {
  color: var(--accent);
}
.contact-form { max-width: 560px; }
.admin-form   { max-width: 520px; margin: 1rem 0; }
.admin-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

label { display: block; margin-top: .75rem; }
input, textarea, select {
  width: 100%;
  padding: .6rem;
  border: 1px solid #e6e2dd;
  border-radius: 0;           /* sharp */
  font-family: inherit;
  font-size: inherit;
}

.flash-wrap { margin-top: 1rem; }
.flash { padding: .75rem; margin-bottom: .5rem; }
.flash.success { background: #f3fff4; border: 1px solid #d8f0d9; color: #1b6b2a; }
.flash.error   { background: #fff3f3; border: 1px solid #f0d8d8; color: #6b1b1b; }
.flash.info    { background: #f3f8ff; border: 1px solid #d8e8f0; color: #1b3b6b; }

/* ─── 10. Measurements table ────────────────────────────────────────────── */
/* No header row (Measurement/Value) — each row labels itself via <th> */
.measurements {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.5rem;
  font-size: .95rem;
}
.measurements th,
.measurements td {
  padding: .5rem .75rem;
  text-align: left;
  border-bottom: 1px solid #e6e2dd;
}
.measurements th {
  width: 45%;
  color: var(--muted);
  font-weight: normal;
  font-style: italic;
}
.measurements td {
  color: var(--accent);
}

/* ─── 11. About ─────────────────────────────────────────────────────────── */

/* ─── 11b. Admin utilities ───────────────────────────────────────────────── */
/* Use these classes in templates instead of inline style="" */
.admin-section { max-width: 680px; }

/* ─── 12. Intro overlay & back-to-top ───────────────────────────────────── */
.site-intro {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250,249,247,0.95);
  z-index: 9999;
  pointer-events: none;  /* only intercepts clicks while actually visible (see .visible below) */
  opacity: 0;
  transform: scale(1.012);
  transition: opacity .8s ease-in-out, transform .9s ease-in-out;
}
.site-intro .intro-inner h1 {
  font-family: 'Georgia', serif;
  font-size: 5rem;
  margin: 0;
  color: var(--accent);
  letter-spacing: .02em;
}
.site-intro.visible { opacity: 1; transform: scale(1); pointer-events: auto; }

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 28px;
  width: 44px;
  height: 44px;
  border-radius: 0;           /* sharp */
  border: none;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
  z-index: 999;
}
.back-to-top svg { display: block; }
.back-to-top:focus { outline: 2px solid #fff; outline-offset: 3px; }
.back-to-top.visible { opacity: 1; transform: translateY(0); }

/* ─── 13. Responsive ────────────────────────────────────────────────────── */

/* Tablet: shrink header elements gradually before the hard stack at 900px */
@media (max-width: 1200px) and (min-width: 901px) {
  .container { padding: 1.5rem; }
  .bureau-name { font-size: 1.1rem; }
  .main-nav ul { gap: 1.25rem; }
  .card-name { font-size: 1.15rem; }
}

@media (max-width: 900px) {
  .profile-columns { grid-template-columns: 1fr; gap: 1.5rem; }
  /* Show the full photo on mobile (no cropping) instead of cover-cropping it */
  .gallery-photo {
    height: auto;
    max-height: 70vh;
    width: min(420px, 92vw);
    object-fit: contain;
    background: var(--bg);
  }
  /* Card tiles must stay a fixed, uniform size for the grid — so instead of
     showing the full photo, crop from the top down (keeps faces in frame
     rather than cutting through the middle). */
  .card img { height: 300px; object-position: top; }
  .hero h2  { font-size: 1.8rem; }
  .site-intro .intro-inner h1 { font-size: 2.6rem; padding: 0 1rem; text-align: center; }
  .site-header .container { flex-direction: column; align-items: center; }
  .bureau-name { margin-left: 0; margin-top: .5rem; padding-top: 0; }
  .main-nav ul { flex-direction: row; gap: 1rem; flex-wrap: wrap; }

  /* Mobile dropdown: inline */
  .main-nav .has-dropdown .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    display: none;
  }
  .main-nav .has-dropdown.open .dropdown { display: flex; gap: .5rem; flex-wrap: wrap; }
  .main-nav .has-dropdown .dropdown a   { padding: .4rem .6rem; }
}

/* Small phones: tighten spacing and type further */
@media (max-width: 480px) {
  .container { padding: 1rem; }
  .bureau-name { font-size: 1rem; }
  .main-nav ul { gap: .6rem .9rem; }
  .main-nav a { font-size: .85rem; }
  .card-name { font-size: 1.05rem; padding: 1rem 1rem .9rem; }
  .hero h2 { font-size: 1.5rem; }
  .site-intro .intro-inner h1 { font-size: 1.9rem; }
}

/* ─── 14. Reduced-motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .site-intro, .back-to-top, .card img, .card-link::after { transition: none; }
}

/* ─── 15. Crop uploader ─────────────────────────────────────────────────── */
.crop-uploader { margin-top: 1.25rem; }
.crop-uploader-label {
  display: block;
  margin-bottom: .5rem;
}
.crop-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .6rem;
}
.crop-thumb {
  position: relative;
  width: 90px;
  height: 120px;
  overflow: hidden;
  background: #eee;
  border: 1px solid #e6e2dd;
}
.crop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.crop-add-btn { margin-top: 0; }

.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.crop-modal[hidden] { display: none; }
.crop-modal-inner {
  background: #fff;
  padding: 1rem;
  max-width: 600px;
  width: 100%;
}
.crop-stage {
  max-height: 70vh;
  background: #222;
}
.crop-stage img { max-width: 100%; display: block; }
.crop-modal-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ─── 16. Image ordering (edit model) ───────────────────────────────────── */
.image-order-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}
.image-order-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem;
  background: #faf9f7;
  border: 1px solid #e6e2dd;
  cursor: grab;
}
.image-order-item.dragging { opacity: .5; }
.image-order-item img {
  width: 70px;
  height: 90px;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
}
.image-order-item .drag-handle {
  color: #aaa;
  font-size: 1.1rem;
  cursor: grab;
  user-select: none;
}
.image-order-item .main-badge {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #111;
  color: #fff;
  padding: .15rem .4rem;
}
.image-order-controls {
  margin-left: auto;
  display: flex;
  gap: .3rem;
}
.btn-mini {
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  border-radius: 0;
}
.btn-mini:hover { background: #f0ede9; }
.btn-mini-danger { color: #b11; border-color: #e0b4b4; }
.btn-mini-danger:hover { background: #fbeaea; }

/* Crop thumbnail reorder controls */
.crop-thumb { width: 110px; height: auto; }
.crop-thumb img { width: 110px; height: 140px; }
.crop-main-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #111;
  color: #fff;
  padding: .1rem .3rem;
}
.crop-thumb-controls {
  display: flex;
  gap: .2rem;
  margin-top: .3rem;
  justify-content: center;
}
.crop-thumb-controls .btn-mini {
  width: 24px;
  height: 24px;
  font-size: .75rem;
}

/* Instagram icon in nav — matches theme accent color */
.main-nav .instagram-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  padding: .25rem .5rem;
}
.main-nav .instagram-link:hover { color: var(--muted); }
.main-nav .instagram-link svg { display: block; }
