/* ============================================================
   Hiiumaa Tenniseklubi — stiilileht
   Mobile-first, vanilla CSS
   ============================================================ */

/* ── Reset & tokens ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #0A7159;
  --green-mid:   #0c9c7b;
  --yellow:      #C5D936;
  --yellow-dark: #adbd2f;
  --white:       #ffffff;
  --gray-light:  #f4f6f4;
  --gray-mid:    #e0e5e0;
  --text:        #1a1a1a;
  --text-muted:  #5a6a5a;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(0,0,0,.12);
  --nav-h:       64px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

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

/* ── Utility ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding-block: 4rem; }
.section--alt { background: var(--gray-light); }

.section__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
  border: none;
}
.btn:active { transform: scale(.97); }

.btn--yellow {
  background: var(--yellow);
  color: var(--text);
}
.btn--yellow:hover { background: var(--yellow-dark); }

.btn--outline {
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
}
.btn--outline:hover { background: rgba(255,255,255,.15); }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-dark);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: box-shadow .2s;
}
.nav--scrolled { box-shadow: var(--shadow); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.nav__logo img { height: 42px; width: auto; }
.nav__logo-name {
  font-family: "Arial Rounded MT Bold", Arial, Helvetica, sans-serif;
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

/* Hamburger */
.nav__burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: opacity .2s;
}

/* Menu */
.nav-menu {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--green-dark);
  flex-direction: column;
  padding: 1rem 1.25rem 1.5rem;
  gap: .25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.nav-menu--open { display: flex; }

.nav-menu a {
  color: var(--white);
  font-weight: 500;
  padding: .6rem 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  opacity: .9;
}
.nav-menu a:hover { opacity: 1; }
.nav-menu .btn { margin-top: .75rem; text-align: center; }

@media (min-width: 768px) {
  .nav__burger { display: none; }

  .nav-menu {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0;
    gap: .25rem;
    background: transparent;
    box-shadow: none;
  }
  .nav-menu a {
    padding: .5rem .75rem;
    border-bottom: none;
    border-radius: var(--radius);
  }
  .nav-menu a:hover { background: rgba(255,255,255,.1); }
  .nav-menu .btn { margin-top: 0; }
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100svh - var(--nav-h));
  background:
    linear-gradient(
      180deg,
      rgba(10, 113, 89, 0.42) 0%,
      rgba(4, 45, 32, 0.82) 100%
    ),
    url('../imgs/hero.png') center 42% / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.hero__inner { position: relative; max-width: 700px; }

.hero__logo {
  height: 110px;
  width: auto;
  margin-inline: auto;
  margin-bottom: 1.75rem;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.35));
}

.hero__title {
  font-family: "Arial Rounded MT Bold", Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: .75rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hero__sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 2rem;
  max-width: 540px;
  margin-inline: auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Tutvustus ───────────────────────────────────────────────── */
.about__text {
  max-width: 720px;
  font-size: 1.05rem;
  color: var(--text);
}

.about__lead {
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.about__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.about__list li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: 1rem;
}
.about__list .icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.6;
}

.about__tagline {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--text-muted);
}

/* ── Facts grid ──────────────────────────────────────────────── */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}
@media (min-width: 640px) {
  .facts-grid { grid-template-columns: repeat(4, 1fr); }
}

.fact-box {
  background: var(--green-dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.fact-box__number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--yellow);
  line-height: 1;
}

.fact-box__label {
  font-size: .9rem;
  opacity: .85;
}

/* ── Sponsors ─────────────────────────────────────────────────── */
.sponsors-featured {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 480px) {
  .sponsors-featured{ grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .sponsors-featured{ grid-template-columns: repeat(3, 1fr); }
}

.sponsor-placeholder--featured .sponsor-logo {
  max-height: 120px;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: center;
  justify-items: center;
}
@media (min-width: 480px) {
  .sponsors-grid { grid-template-columns: repeat(4, 1fr); }
}

.sponsor-placeholder {
  background: var(--white);
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem;
}

.sponsor-logo {
  display: block;
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
  transition: filter .15s;
}


.sponsor-placeholder--lg .sponsor-logo {
  max-height: 100px;
}

.sponsor-placeholder--xlg .sponsor-logo {
  max-height: 200px;
}

/* ── Calendar ────────────────────────────────────────────────── */
.calendar-wrap { max-width: 700px; }

.cal-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cal-nav__btn {
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.cal-nav__btn:hover { background: var(--green-mid); }

#cal-header {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-dark);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--gray-mid);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-day-header {
  background: var(--green-dark);
  color: var(--white);
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  padding: .4rem 0;
  letter-spacing: .05em;
}

.cal-cell {
  background: var(--white);
  min-height: 56px;
  padding: .3rem .4rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: default;
}
.cal-cell--empty  { background: var(--gray-light); }
.cal-cell--today  { background: #edfaf1; }
.cal-cell--today .cal-cell__num { color: var(--green-dark); font-weight: 700; }

.cal-cell--has-events { cursor: pointer; }
.cal-cell--has-events:hover { background: #f0faf2; }

.cal-cell__num  { font-size: .85rem; line-height: 1; }
.cal-cell__event {
  display: block;
  width: 100%;
  height: 8px;
  background: var(--yellow-dark);
  border-radius: 2px;
  margin-top: 3px;
}
.cal-cell__event--more {
  background: var(--text-muted);
}

.cal-notice {
  grid-column: 1 / -1;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
  background: var(--white);
}

/* Event cards */
#cal-events { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.cal-event-card {
  background: var(--white);
  border-left: 4px solid var(--yellow-dark);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.cal-event-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.cal-event-card__time { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.cal-event-card__desc { font-size: .9rem; white-space: pre-wrap; }
.cal-event-card__desc a { color: var(--green-dark); text-decoration: underline; word-break: break-all; }
.cal-event-card__link {
  display: inline-block;
  margin-top: .75rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--green-dark);
}
.cal-event-card__link:hover { text-decoration: underline; }

/* ── Contact ─────────────────────────────────────────────────── */
.contact__grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 640px) {
  .contact__grid { grid-template-columns: 1fr 1fr; }
}

.contact__block h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.contact__block p,
.contact__block a { font-size: 1rem; color: var(--text); }
.contact__block a:hover { color: var(--green-dark); text-decoration: underline; }

.contact__socials {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
  border-radius: var(--radius);
  padding: .45rem 1rem;
  transition: background .15s, color .15s;
}
.social-link:hover {
  background: var(--green-dark);
  color: var(--white);
  text-decoration: none;
}
.social-link svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.75);
  padding: 2rem 1.25rem;
  text-align: center;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
  margin-bottom: 1rem;
}

.footer__links a {
  color: rgba(255,255,255,.8);
  font-size: .875rem;
  cursor: pointer;
}
.footer__links a:hover { color: var(--white); text-decoration: underline; }

.footer__copy { font-size: .8rem; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.55);
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal--open { display: flex; }

.modal__box {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  padding: 2rem;
  position: relative;
  margin-block: auto;
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--gray-light);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.modal__close:hover { background: var(--gray-mid); }

/* Modal content typography */
.modal-content h1,
.modal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-dark);
  margin: 1.5rem 0 .5rem;
}
.modal-content h1:first-child,
.modal-content h2:first-child { margin-top: 0; }

.modal-content p  { margin-bottom: .75rem; font-size: .95rem; }
.modal-content ol,
.modal-content ul { padding-left: 1.4rem; margin-bottom: .75rem; }
.modal-content li { font-size: .95rem; margin-bottom: .35rem; }
.modal-content strong { font-weight: 700; }

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (min-width: 768px) {
  .section__title { font-size: 2.1rem; }
  .cal-cell { min-height: 64px; }
  .cal-cell__num { font-size: .9rem; }
}
