/* Shared styles: colour tokens, page layout, header, footer and the coast map. */

:root {
  color-scheme: light;
  --ink: #1d1d24;
  --muted: #5b5a66;
  --bg: #ffffff;
  --cyan: #14a39a;
  --link: #0b7a73;
  --panel: #ffffff;
  --line: #d9d9e3;
  --control-edge: rgba(29, 29, 36, 0.12);
  --control-bg: rgba(29, 29, 36, 0.05);
  --flag-edge: rgba(29, 29, 36, 0.25);
  --map-sea: #d7ebf2;
  --map-land: #f4f0e6;
  --map-edge: #9db7c4;
  --ray-rise: #c46a12;
  --ray-set: #a8466f;
  --ray-now: #e39b0b;
  --logo-sun: #ff9a3c;
  --logo-rays: #f5a524;
  --logo-accent: #e8841a;
  --radius: 0.875rem;
  --edge-gap: clamp(1rem, 3vw, 1.75rem);
  --theme-transition: 0.3s ease;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f6f2ea;
  --muted: #c9c8d0;
  --bg: #4a4b50;
  --cyan: #75d9d2;
  --link: #75d9d2;
  --panel: #55565c;
  --line: #6a6b72;
  --control-edge: rgba(255, 255, 255, 0.1);
  --control-bg: rgba(255, 255, 255, 0.08);
  --flag-edge: rgba(255, 255, 255, 0.35);
  --map-sea: #3b4a57;
  --map-land: #5d5f66;
  --map-edge: #7b8894;
  --ray-rise: #f0a45a;
  --ray-set: #e58ab0;
  --ray-now: #f4c451;
  --logo-sun: #ffb347;
  --logo-rays: #ffc15e;
  --logo-accent: #ffb347;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-text);
  line-height: 1.55;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--edge-gap) 1rem 0;
}

.site-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
  text-decoration: none;
}

.site-logo {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  fill: none;
  stroke-linecap: round;
}

.logo-frame {
  stroke: currentColor;
  stroke-width: 4;
}

.logo-rays {
  stroke: var(--logo-rays);
  stroke-width: 3.5;
}

.logo-sun {
  fill: var(--logo-sun);
}

.logo-horizon {
  stroke: var(--cyan);
  stroke-width: 4;
}

.site-name-a {
  color: var(--logo-accent);
}

.site-home:hover .site-name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--control-edge);
  border-radius: 50%;
  color: var(--ink);
  background: var(--control-bg);
  cursor: pointer;
  transition: background-color var(--theme-transition), color var(--theme-transition);
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  border-color: var(--cyan);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.language-list {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.language-link {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-bottom: 2px solid transparent;
  border-radius: 0.375rem;
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.language-link:hover,
.language-link[aria-current="true"] {
  opacity: 1;
}

.language-link[aria-current="true"] {
  border-bottom-color: var(--cyan);
}

.language-link img {
  display: block;
  width: 1.75rem;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--flag-edge);
}

/* Page content */

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.page h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 400;
  line-height: 1.2;
}

.page a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

.page-lead {
  max-width: 65ch;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.page-section {
  margin-top: 3rem;
}

.page-section p {
  max-width: 70ch;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
}

.breadcrumb li + li::before {
  margin-right: 0.5rem;
  content: "›";
}

.page .breadcrumb a {
  color: var(--muted);
}

.page .breadcrumb a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}

/* Guide article */

.article-body {
  max-width: 44rem;
  line-height: 1.65;
}

.article-body h2 {
  margin-top: 2.5rem;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body ul,
.article-body ol {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

.article-figure {
  margin: 1.5rem 0 2rem;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.article-figure figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.faq dt {
  margin-top: 1.25rem;
  font-weight: 700;
}

.faq dd {
  margin: 0.35rem 0 0;
}

.site-footer-article a {
  font-weight: 600;
}

/* Coast map (shared by the home page and viewpoint pages) */

.map-sea {
  fill: var(--map-sea);
}

.map-land {
  fill: var(--map-land);
  stroke: var(--map-edge);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.map-town {
  fill: var(--muted);
  font-family: var(--font-text);
  font-weight: 600;
  text-anchor: middle;
}

/* Pan and zoom (js/map-zoom.js) */

.map-frame {
  position: relative;
}

.map-frame.is-zoomable svg {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-frame svg:focus:not(:focus-visible) {
  outline: none;
}

.map-frame.is-zoomable svg:active {
  cursor: grabbing;
}

.map-zoom {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.map-zoom[hidden] {
  display: none;
}

.map-zoom button {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.map-zoom button:hover {
  border-color: var(--cyan);
}

/* Wedges are drawn around 0,0 and placed with --x/--y so they keep their size when zooming. */
.map-wedge-scaled {
  transform: translate(calc(var(--x) * 1px), calc(var(--y) * 1px)) scale(var(--map-scale, 1));
}

.map-credit {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Book promo (Polish pages). Fixed colours: the cover images are flattened onto this background. */

.promo {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius);
  color: #f6f2ea;
  background: #0e3350;
}

.page .promo h2 {
  margin-bottom: 1.25rem;
}

.promo-eyebrow {
  margin: 0 0 0.25rem;
  color: #b9c7d4;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.promo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.promo-item {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.promo-item img {
  flex: none;
  width: clamp(6.5rem, 22vw, 8.5rem);
  height: auto;
}

.promo-body h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.promo-body p {
  margin: 0 0 0.9rem;
  color: #d6dee6;
}

.page .promo-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  color: #1d1d24;
  background: #ffb347;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.page .promo-button:hover {
  background: #ffc978;
}

.promo-button:focus-visible {
  outline: 2px solid #f6f2ea;
  outline-offset: 3px;
}

/* Side card promo (Polish pages): a small cover at the bottom left on narrow screens,
   a full card beside the content on wide screens. */

.promo-card {
  position: fixed;
  z-index: 5;
  bottom: 0.75rem;
  left: 0.75rem;
  border-radius: 0.5rem;
  color: #f6f2ea;
  background: #0e3350;
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.25);
}

.promo-card.is-dismissed {
  display: none;
}

/* The side card appears 3 seconds after the page loads (CSS only, so it never flashes first). */
.promo-card {
  animation: promo-card-in 0.5s ease 3s both;
}

@keyframes promo-card-in {
  from {
    visibility: hidden;
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    visibility: visible;
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo-card {
    animation-duration: 0.01s;
  }
}

/* Leave room under the footer so the small card does not cover it at the end of the page. */
@media (max-width: 89.99rem) {
  body:has(.promo-card:not(.is-dismissed)) .site-footer {
    padding-bottom: 7rem;
  }
}

.promo-card-link {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.4rem;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.promo-card-link img {
  display: block;
  width: 3rem;
  height: auto;
}

/* Vertical label beside the cover, read from bottom to top like a book spine. */
.promo-card-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* The small version shows only the label and the cover; the rest stays for screen readers. */
.promo-card-title,
.promo-card-cta {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.promo-card-close {
  position: absolute;
  top: -1rem;
  right: -0.6rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 2px solid #0e3350;
  border-radius: 50%;
  color: #0e3350;
  background: #f6f2ea;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.promo-card-close[hidden] {
  display: none;
}

.promo-card-link:focus-visible,
.promo-card-close:focus-visible {
  outline: 2px solid #ffb347;
  outline-offset: 2px;
}

@media (min-width: 90rem) {
  /* Same layout as the small card, just larger and at the bottom right, beside the content. */
  .promo-card {
    right: 1.25rem;
    bottom: 1.5rem;
    left: auto;
    border-radius: var(--radius);
  }

  .promo-card-link {
    gap: 0.45rem;
    padding: 0.6rem;
  }

  .promo-card-link img {
    width: 5.5rem;
  }

  .promo-card-label {
    font-size: 0.75rem;
  }
}

/* Footer */

.site-footer {
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 0.5rem;
}

/* The guide link gets its own line, above the article link. */
#photo-rights a {
  display: block;
  margin-top: 0.5rem;
}

.site-footer-note {
  font-size: 0.8rem;
}

.site-footer .site-footer-disclaimer {
  max-width: 60ch;
  margin-inline: auto;
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Share button (js/share.js) */

.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  margin-top: 1rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.4em 1.1em;
  border: 1px solid var(--cyan);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.share-button[hidden] {
  display: none;
}

.share-button:hover {
  background: color-mix(in srgb, var(--cyan) 12%, transparent);
}

.share-icon {
  flex: none;
  color: var(--cyan);
}

.share-status {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* "Plan your visit" affiliate links (English pages) */

.plan-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page .plan-link {
  display: grid;
  gap: 0.35rem;
  height: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  background: var(--panel);
}

.page .plan-link:hover {
  border-color: var(--cyan);
}

.plan-link-title {
  font-weight: 600;
}

.plan-link-via {
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-note {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Social media links in the footer */

.site-footer-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0;
}

.site-footer-social-label {
  color: var(--muted);
}

.site-footer-social ul {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page .social-link,
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}

.social-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.social-link svg {
  fill: currentColor;
}
