/* ==========================================================================
   WebFotoPoint Reschenpass — modern UI
   A responsive redesign. Photo storage, naming and access are unchanged;
   this file only governs presentation.

   Palette is drawn from high-altitude alpine light: cool haze, snow-shadow
   blue, glacial water. Deliberately not warm-cream or near-black.
   ========================================================================== */

:root {
  --sky:      #e9eef3;   /* page wash — alpine haze                */
  --sky-deep: #dbe4ec;   /* secondary wash                          */
  --surface:  #ffffff;   /* cards, panels                           */
  --ink:      #17222e;   /* primary text — deep snow-shadow         */
  --slate:    #40586d;   /* secondary text                          */
  --stone:    #7d8c99;   /* muted labels, meta                      */
  --line:     #d3dde5;   /* hairlines, borders                      */
  --glacier:  #2f7ba6;   /* accent — glacial water                  */
  --glacier-deep: #1f5c80;
  --glacier-soft: #e2eef5;
  --gold:     #c98a3c;   /* warm counterpoint, used sparingly       */

  --radius:   14px;
  --radius-sm: 9px;
  --shadow:   0 1px 2px rgba(23,34,46,.06), 0 8px 24px -12px rgba(23,34,46,.22);
  --shadow-lg: 0 12px 48px -12px rgba(23,34,46,.45);

  --font: Arial, Helvetica, "Segoe UI", sans-serif;
  --font-display: Arial, Helvetica, "Segoe UI", sans-serif;

  --maxw: 1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--sky);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

a { color: var(--glacier-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout shell ------------------------------------------------------- */

.fp-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}

/* ---- Site header -------------------------------------------------------- */

.fp-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.fp-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px clamp(20px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.fp-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.fp-brand__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 1rem + 1vw, 1.6rem);
  letter-spacing: -.01em;
  color: var(--ink);
  white-space: nowrap;
}
.fp-brand__sub {
  color: var(--stone);
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-header__nav { display: flex; gap: 8px; align-items: center; }

/* ---- Buttons ------------------------------------------------------------ */

.fp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .05s;
  text-decoration: none;
  white-space: nowrap;
}
.fp-btn:hover { border-color: var(--glacier); color: var(--glacier-deep); text-decoration: none; }
.fp-btn:active { transform: translateY(1px); }
.fp-btn svg { width: 17px; height: 17px; flex: none; }
.fp-btn--primary {
  background: var(--glacier);
  border-color: var(--glacier);
  color: #fff;
}
.fp-btn--primary:hover { background: var(--glacier-deep); border-color: var(--glacier-deep); color: #fff; }
.fp-btn--ghost { background: transparent; }
.fp-btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--glacier);
  outline-offset: 2px;
}

/* ---- Hero (index) ------------------------------------------------------- */

.fp-hero { padding-top: clamp(20px, 4vw, 44px); padding-bottom: clamp(28px, 5vw, 56px); }

.fp-hero__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.fp-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 .35em;
  max-width: 16ch;
}
.fp-hero__lede {
  color: var(--slate);
  font-size: 1.02rem;
  max-width: 54ch;
  margin: 0;
}
.fp-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--glacier-deep);
  background: var(--glacier-soft);
  border: 1px solid color-mix(in srgb, var(--glacier) 25%, transparent);
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
}
.fp-live-tag__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--glacier);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--glacier) 60%, transparent);
  animation: fp-pulse 2.4s ease-out infinite;
}
@keyframes fp-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glacier) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px color-mix(in srgb, var(--glacier) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glacier) 0%, transparent); }
}

/* The live frame */
.fp-frame {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: var(--sky-deep);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  cursor: zoom-in;
  aspect-ratio: var(--frame-ratio, 3 / 2);
}
.fp-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.fp-frame__cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 34px 18px 14px;
  background: linear-gradient(to top, rgba(12,20,28,.72), transparent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .86rem;
  pointer-events: none;
}
.fp-frame__cap .fp-frame__hint {
  opacity: .82;
  display: inline-flex; align-items: center; gap: 6px;
}
.fp-frame__cap svg { width: 15px; height: 15px; }

.fp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.fp-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}
@media (min-width: 940px) {
  .fp-hero__grid { grid-template-columns: minmax(0,1fr) 300px; }
}

/* Aside card on hero */
.fp-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.fp-aside h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 4px;
}
.fp-aside p { color: var(--slate); font-size: .92rem; margin: 0 0 16px; }
.fp-aside__links { display: grid; gap: 8px; }
.fp-linkrow {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color .15s, background .15s;
  font-size: .93rem;
}
.fp-linkrow:hover { border-color: var(--glacier); background: var(--glacier-soft); text-decoration: none; }
.fp-linkrow svg { width: 20px; height: 20px; color: var(--glacier); flex: none; }
.fp-linkrow span { display: block; }
.fp-linkrow small { display: block; color: var(--stone); font-size: .78rem; }

/* ---- Footer ------------------------------------------------------------- */

.fp-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(40px, 8vw, 90px);
  padding: 26px 0 40px;
  color: var(--stone);
  font-size: .84rem;
}
.fp-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  justify-content: space-between; align-items: center;
}
.fp-footer a { color: var(--slate); }

/* ==========================================================================
   Archive
   ========================================================================== */

.fp-archive { padding-top: clamp(18px, 3vw, 34px); padding-bottom: 40px; }

.fp-archive__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 3vw, 30px);
  align-items: start;
}
@media (min-width: 900px) {
  .fp-archive__layout { grid-template-columns: 320px minmax(0,1fr); }
}

/* calendar / controls column */
.fp-cal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: 84px;
}
@media (max-width: 899px) {
  .fp-cal { position: static; }
}

.fp-cal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 14px;
}
.fp-cal__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: capitalize;
}
.fp-cal__nav { display: flex; gap: 6px; }
.fp-icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.fp-icon-btn:hover:not(:disabled) { border-color: var(--glacier); color: var(--glacier-deep); }
.fp-icon-btn:disabled { opacity: .35; cursor: default; }
.fp-icon-btn svg { width: 18px; height: 18px; }

table.fp-calgrid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.fp-calgrid th {
  font-size: .72rem;
  font-weight: 700;
  color: var(--stone);
  padding: 6px 0 8px;
  text-align: center;
}
.fp-calgrid td { padding: 2px; text-align: center; }
.fp-day {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  font-size: .86rem;
  color: var(--slate);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.fp-day--empty { color: var(--line); }
.fp-day--has {
  color: var(--ink);
  font-weight: 700;
  background: var(--glacier-soft);
  border-color: color-mix(in srgb, var(--glacier) 22%, transparent);
}
.fp-day--has:hover { background: var(--glacier); color: #fff; text-decoration: none; }
.fp-day--today { outline: 2px solid var(--gold); outline-offset: -2px; }
.fp-day--active {
  background: var(--glacier) !important;
  border-color: var(--glacier) !important;
  color: #fff !important;
}
.fp-day--none { color: var(--stone); opacity: .5; }

.fp-cal__legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .76rem; color: var(--stone);
}
.fp-cal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.fp-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.fp-swatch--has { background: var(--glacier-soft); border: 1px solid color-mix(in srgb, var(--glacier) 30%, transparent); }
.fp-swatch--today { border: 2px solid var(--gold); }

/* results column */
.fp-results__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.fp-results__head > div { min-width: 0; }
.fp-results__date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 1rem + 1.2vw, 1.7rem);
  letter-spacing: -.01em;
  text-transform: capitalize;
  margin: 0;
}
.fp-results__count { color: var(--stone); font-size: .9rem; }
.fp-daynav { display: flex; gap: 8px; flex: none; }
@media (max-width: 460px) {
  .fp-results__head { flex-direction: column; align-items: stretch; }
  .fp-daynav { justify-content: flex-end; }
}

.fp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(10px, 1.6vw, 16px);
}
.fp-thumb {
  position: relative;
  border: 0;
  padding: 0;
  background: var(--sky-deep);
  border-radius: 0;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 3 / 2;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  display: block;
}
.fp-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.fp-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.fp-thumb:hover img { transform: scale(1.04); }
.fp-thumb__time {
  position: absolute; left: 0; bottom: 0;
  background: rgba(12,20,28,.72);
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 0;
  backdrop-filter: blur(2px);
}

.fp-empty {
  text-align: center;
  padding: clamp(40px, 8vw, 80px) 20px;
  color: var(--stone);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.fp-empty svg { width: 40px; height: 40px; color: var(--line); margin: 0 auto 12px; }
.fp-empty h3 { color: var(--slate); font-family: var(--font-display); font-weight: 700; margin: 0 0 4px; font-size: 1.15rem; }
.fp-empty p { margin: 0; font-size: .92rem; }

/* ==========================================================================
   Lightbox (replaces popup windows)
   ========================================================================== */

.fp-lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 40px);
  background: rgba(10,16,22,.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.fp-lb.is-open { display: flex; }
.fp-lb__stage {
  position: relative;
  max-width: min(1400px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column;
  gap: 12px;
}
.fp-lb__imgwrap {
  position: relative;
  background: #0b1218;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.fp-lb__img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto; height: auto;
  object-fit: contain;
  display: block;
}
.fp-lb__spinner {
  position: absolute;
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fp-spin .8s linear infinite;
}
@keyframes fp-spin { to { transform: rotate(360deg); } }

.fp-lb__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  color: #eef3f7;
}
.fp-lb__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fp-lb__meta strong { font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }
.fp-lb__meta span { color: #9fb0bd; font-size: .84rem; }
.fp-lb__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fp-lb__btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: .86rem; font-weight: 500;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #eef3f7;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.fp-lb__btn:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.fp-lb__btn svg { width: 16px; height: 16px; }

.fp-lb__nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(12,20,28,.55);
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  z-index: 2;
}
.fp-lb__nav:hover:not(:disabled) { background: rgba(12,20,28,.85); }
.fp-lb__nav:disabled { opacity: .3; cursor: default; }
.fp-lb__nav svg { width: 22px; height: 22px; }
.fp-lb__nav--prev { left: 12px; }
.fp-lb__nav--next { right: 12px; }
.fp-lb__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(12,20,28,.55);
  color: #fff; cursor: pointer; z-index: 3;
  transition: background .15s;
}
.fp-lb__close:hover { background: rgba(12,20,28,.9); }
.fp-lb__close svg { width: 20px; height: 20px; }

@media (max-width: 620px) {
  .fp-lb__nav { width: 40px; height: 40px; }
  .fp-lb__img { max-height: calc(100vh - 180px); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
}

/* skip cross-frame print artifacts */
@media print {
  .fp-header, .fp-footer, .fp-hero__actions, .fp-cal, .fp-daynav { display: none; }
}
