* {
  box-sizing: border-box;
}

:root {
  --stefun-primary: #79c6c0;
  --stefun-bar-bg: #5eb0a7;
  --stefun-body: #878786;
  --stefun-bg: #79c6c0;
  --stefun-card: #ffffff;
  --stefun-text-dark: #878786;
  --stefun-heading-font: 'Pacifico', cursive;
  --stefun-body-font: 'Roboto', Arial, sans-serif;
  --stefun-border: rgba(121, 198, 192, 0.35);
  --stefun-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --stefun-error: #cf2e2e;
  --stefun-pattern: url('../assets/stefun_pattern_turkis+HG.jpg');
  --header-height: 4.25rem;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--stefun-body-font);
  font-size: 14px;
  line-height: 1.7;
  color: var(--stefun-body);
  background-color: var(--stefun-bar-bg);
  background-image: var(--stefun-pattern);
  background-repeat: repeat;
  background-size: auto;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--stefun-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* —— Header / Nav —— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--stefun-bar-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo img {
  height: 2.75rem;
  width: 2.75rem;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* —— Main layout —— */

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.site-main--home {
  padding-top: 0.75rem;
}

.site-main--home .page-panel {
  margin-top: 0.25rem;
}

.page-panel {
  background: var(--stefun-card);
  border: 1px solid var(--stefun-border);
  border-radius: 20px;
  box-shadow: var(--stefun-shadow);
  padding: 2rem 2.5rem;
}

.page-title {
  margin: 0 0 0.5rem;
  font-family: var(--stefun-heading-font);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 500;
  color: var(--stefun-primary);
  text-align: center;
  line-height: 1.2;
}

.page-lead {
  margin: 0 0 2rem;
  text-align: center;
  font-size: 1rem;
  color: var(--stefun-body);
}

/* —— Footer —— */

.site-footer {
  padding: 1.25rem 1.5rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.85rem;
  background: var(--stefun-bar-bg);
}

.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer__claim {
  margin: 0;
  font-family: var(--stefun-heading-font);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  text-align: left;
  line-height: 1.3;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin-left: auto;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer__legal a:hover {
  text-decoration: underline;
}

.legal-content h2 {
  margin: 2rem 0 0.75rem;
  font-family: var(--stefun-body-font);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--stefun-text-dark);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content ul {
  margin: 0 0 1rem;
}

.legal-content ul {
  padding-left: 1.25rem;
}

.legal-content li + li {
  margin-top: 0.35rem;
}

.legal-placeholder {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(121, 198, 192, 0.2);
  color: var(--stefun-text-dark);
  font-weight: 500;
}

/* —— Home landing hero —— */

.home-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: clamp(220px, 36vh, 420px);
  margin: 0 0 1.75rem;
  padding: 1.5rem 1rem 0.5rem;
}

.home-hero__logo {
  display: block;
  width: min(88vw, 476px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  filter:
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.14))
    drop-shadow(0 12px 32px rgba(0, 0, 0, 0.22));
}

/* —— Instagram feed —— */

.instagram-feed {
  width: 100%;
}

.site-main--home .instagram-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  width: 100%;
}

.instagram-card {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border-radius: 20px;
  border: none;
  padding: 1.7rem;
  background: #fff;
  box-shadow: var(--stefun-shadow);
  text-decoration: none;
}

.instagram-card:hover {
  text-decoration: none;
}

.instagram-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.instagram-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
}

.instagram-card img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.instagram-card:hover img {
  transform: scale(1.04);
}

.instagram-card__badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.instagram-status {
  margin: 1rem 0 0;
  text-align: center;
  color: #fff;
  font-size: 0.95rem;
}

.instagram-status.is-error {
  color: #fff3f3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.instagram-sentinel {
  width: 100%;
  height: 1px;
  margin-top: 0.5rem;
  pointer-events: none;
}

@media (min-width: 768px) {
  .site-main--home .instagram-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .site-main--home .instagram-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* —— Blog —— */

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-post {
  width: 100%;
}

.blog-post__layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.blog-post__thumb {
  flex: 0 0 auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}

.blog-post__thumb:focus-visible {
  outline: 2px solid var(--stefun-primary);
  outline-offset: 3px;
}

.blog-post__thumb img {
  display: block;
  width: 140px;
  height: 105px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.blog-post__thumb:hover img {
  transform: scale(1.04);
}

.blog-post__content {
  flex: 1;
  min-width: 0;
}

.blog-post__meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--stefun-body);
}

.blog-post__title {
  margin: 0 0 1rem;
  font-family: var(--stefun-heading-font);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 500;
  color: var(--stefun-primary);
  line-height: 1.25;
}

.blog-post__excerpt {
  margin: 0 0 1rem;
}

.blog-post__body {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--stefun-border);
}

.blog-post.is-expanded .blog-post__body {
  display: block;
}

.blog-post.is-expanded .blog-post__excerpt {
  display: none;
}

.blog-toggle {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: 10px;
  background: var(--stefun-primary);
  color: #fff;
  font-family: var(--stefun-body-font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.blog-toggle:hover {
  filter: brightness(0.95);
}

/* —— Reviews —— */

.site-main--reviews > .page-title {
  color: #fff;
}

.site-main--reviews > .page-lead {
  color: #fff;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.review-card__meta {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
}

.review-card__course {
  font-size: 1.425rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--stefun-primary);
}

.review-card__context {
  color: var(--stefun-body);
}

.review-card__body {
  margin: 0 0 1.25rem;
  font-size: 1.3em;
  text-align: left;
  line-height: 1.7;
  color: var(--stefun-body);
}

.review-card__author {
  margin: 0 0 0.35rem;
  font-family: var(--stefun-heading-font);
  font-size: clamp(1.215rem, 2.7vw, 1.575rem);
  color: var(--stefun-primary);
  text-align: left;
  line-height: 1.3;
}

.review-card__date {
  margin: 0;
  font-size: 0.85rem;
  color: var(--stefun-body);
  text-align: left;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.78);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox__img {
  display: block;
  max-width: min(92vw, 960px);
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.image-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--stefun-text-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__close:hover {
  filter: brightness(0.95);
}

/* —— Contact form —— */

.contact-form {
  max-width: 28rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-weight: 500;
  font-size: 0.9rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--stefun-border);
  border-radius: 10px;
  font-family: var(--stefun-body-font);
  font-size: 1rem;
  color: var(--stefun-text-dark);
  background: #fff;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--stefun-primary);
  outline-offset: 1px;
}

.form-field textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-error {
  margin: 0;
  color: var(--stefun-error);
  font-size: 0.9rem;
  display: none;
}

.form-error.is-visible {
  display: block;
}

.form-success {
  display: none;
  text-align: center;
  padding: 1.5rem;
}

.form-success.is-visible {
  display: block;
}

.form-success h2 {
  margin: 0 0 0.5rem;
  font-family: var(--stefun-heading-font);
  font-size: 2rem;
  font-weight: 500;
  color: var(--stefun-primary);
}

.btn-primary {
  align-self: flex-start;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 10px;
  background: var(--stefun-primary);
  color: #fff;
  font-family: var(--stefun-body-font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(0.95);
}

.captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.captcha-row .form-field {
  flex: 1 1 10rem;
}

/* —— Online tools —— */

.tool-back {
  display: inline-block;
  margin: 1.5rem 0 0;
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  background: var(--stefun-bar-bg);
  color: #fff;
  font-family: var(--stefun-body-font);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.tool-back:hover {
  filter: brightness(0.95);
}

.mod-calc__back {
  margin: 0;
  text-align: center;
}

.tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 36rem;
  margin-inline: auto;
}

.tools-list li + li {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--stefun-border);
}

.tools-list a {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--stefun-primary);
  text-decoration: none;
}

.tools-list a:hover {
  text-decoration: underline;
}

.tools-list p {
  margin: 0.35rem 0 0;
}

/* —— Dive map —— */

.map-panel {
  padding: 1rem;
}

#dive-map {
  width: 100%;
  height: min(70vh, 560px);
  border-radius: 14px;
  overflow: hidden;
  z-index: 1;
  background: #79c6c0;
}

#dive-map.leaflet-container {
  background: #79c6c0;
}

.dive-popup {
  text-align: center;
  min-width: 140px;
}

.dive-popup__title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--stefun-text-dark);
  font-size: 1rem;
}

.dive-popup img {
  width: 100%;
  max-width: 220px;
  border-radius: 8px;
  margin: 0 auto;
}

.dive-popup__caption {
  margin: 0;
  font-size: 0.85rem;
  color: var(--stefun-body);
}

/* —— Responsive —— */

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--stefun-bar-bg);
    padding: 0.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--stefun-shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .page-panel {
    padding: 1.5rem 1.25rem;
  }

  .home-hero {
    min-height: clamp(180px, 30vh, 300px);
    padding: 1.25rem 0.75rem 0.25rem;
    margin-bottom: 1.25rem;
  }

  .home-hero__logo {
    width: min(92vw, 364px);
  }

  .blog-post__layout {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-post__thumb {
    align-self: center;
  }

  .blog-post__thumb img {
    width: min(100%, 280px);
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .map-panel {
    padding: 0.65rem;
  }

  #dive-map {
    height: min(60vh, 420px);
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__legal {
    margin-left: 0;
  }
}

/* —— Oxygen analysing game —— */

.o2-tool {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2.25rem 1.75rem;
  border: 1px solid var(--stefun-border);
  border-radius: 20px;
  background: var(--stefun-card);
  box-shadow: var(--stefun-shadow);
}

.o2-tool__title {
  margin: 0 0 0.75rem;
  font-family: var(--stefun-heading-font);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  color: var(--stefun-primary);
  text-align: center;
  line-height: 1.2;
}

.o2-tool__lead {
  margin: 0 0 1.75rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--stefun-body);
  line-height: 1.55;
}

.o2-tool__lead--mobile {
  display: none;
}

.o2-tool.is-mobile .o2-tool__lead--desktop {
  display: none;
}

.o2-tool.is-mobile .o2-tool__lead--mobile {
  display: block;
}

.o2-tool__back {
  margin: 1.5rem 0 0;
  text-align: center;
}

.o2-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem 1.75rem;
  align-items: start;
  touch-action: none;
}

.o2-game__pool,
.o2-game__slots {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.o2-game__cell {
  position: relative;
  min-height: 3.1rem;
  border-radius: 12px;
  background: #e8e8e8;
  transition: outline-color 0.15s ease, background-color 0.15s ease;
}

.o2-game__cell.is-drop-target {
  outline: 2px solid var(--stefun-primary);
  outline-offset: 2px;
}

.o2-game__cell--slot {
  min-height: 3.25rem;
  background: #fff;
  border: 1.5px solid var(--stefun-primary);
}

.o2-game__slot-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 700;
  color: rgba(121, 198, 192, 0.45);
  pointer-events: none;
  user-select: none;
}

.o2-game__tile {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.1rem;
  margin: 0;
  padding: 0.65rem 0.9rem;
  border: none;
  border-radius: 12px;
  background: var(--stefun-primary);
  color: #fff;
  font-family: var(--stefun-body-font);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.o2-game__tile:active,
.o2-game__tile--dragging {
  cursor: grabbing;
}

.o2-game__tile--dragging {
  opacity: 0.35;
}

.o2-game__tile--ghost {
  position: fixed;
  z-index: 2000;
  margin: 0;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0.95;
}

.o2-game__tile.is-insert-before {
  box-shadow: inset 0 3px 0 0 var(--stefun-bar-bg);
}

.o2-game__pool--list {
  gap: 0.5rem;
}

.o2-game__pool--list .o2-game__tile {
  min-height: 2.85rem;
}

.o2-game__board {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.o2-game__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.o2-game__link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--stefun-primary);
  font-family: var(--stefun-body-font);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

.o2-game__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.o2-game__btn {
  display: block;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: var(--stefun-primary);
  color: #fff;
  font-family: var(--stefun-body-font);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

.o2-game__btn:hover {
  filter: brightness(0.97);
}

.o2-game__modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.45);
}

.o2-game__modal[hidden] {
  display: none;
}

.o2-game__modal-dialog {
  width: min(100%, 28rem);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.o2-game__modal-title {
  margin: 0 0 0.75rem;
  font-family: var(--stefun-heading-font);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
  color: var(--stefun-primary);
  line-height: 1.2;
}

.o2-game__modal-body {
  margin: 0 0 1.25rem;
  color: var(--stefun-body);
  line-height: 1.6;
}

.o2-game__modal-dialog .o2-game__btn {
  width: auto;
  min-width: 6rem;
  margin: 0 auto;
}

@media (max-width: 800px) {
  .o2-tool {
    padding: 1.5rem 1.15rem 1.35rem;
  }

  .o2-game {
    grid-template-columns: 1fr;
  }

  .o2-tool.is-mobile .o2-game__board {
    display: contents;
  }

  .o2-tool.is-mobile .o2-game__slots {
    display: none;
  }

  .o2-tool.is-mobile .o2-game__pool {
    order: 1;
  }

  .o2-tool.is-mobile .o2-game__actions {
    order: 2;
    margin-top: 1.5rem;
  }

  .o2-tool.is-mobile .o2-game__tile {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    min-height: 2.75rem;
  }
}
