/* -------------------- Variables -------------------- */
:root {
  --color-primary: #cc0000;
  --color-primary-dark: #a30000;
  --color-secondary: #536878;
  --color-bg: #fff;
  --color-text: #000;
  --color-card-bg: #fff;
  --color-card-text: #222;
  --color-card-shadow: rgba(0,0,0,0.2);
  --border-radius: 6px;
  --gap: 1rem;
}

/* -------------------- Global Reset -------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body, html {
  font-family: "Helvetica", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

/* -------------------- Navbar -------------------- */
.navbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: var(--color-bg);
  padding: 5px 2rem;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  gap: var(--gap);
}

.nav-left .logo { max-height: 200px; width: auto; object-fit: contain; }
.nav-center { display: flex; justify-content: center; }

.stats-box { display: flex; gap: 20px; }
.stat { display: flex; flex-direction: column; align-items: center; font-weight: 700; color: var(--color-text); }
.stat-number { font-size: 1.4rem; }
.stat-label { font-size: 0.8rem; text-transform: uppercase; }

/* -------------------- Search Box -------------------- */
.nav-right .search-wrapper { position: relative; width: 200px; transition: width 0.3s ease; }
.nav-right input {
  width: 100%;
  padding: 6px 30px 6px 10px;
  border-radius: var(--border-radius);
  border: 1px solid #ccc;
  font-size: 0.9rem;
}
.nav-right .search-icon { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #555; cursor: pointer; font-size: 1rem; }

@media (max-width: 786px) {
  .nav-right .search-wrapper { width: 40px; }
  .nav-right input {
    width: 0; opacity: 0; position: absolute; top: 50%; right: 0; transform: translateY(-50%);
    padding: 4px 8px; pointer-events: none; font-size: 0.85rem;
    transition: width 0.3s, opacity 0.3s, padding 0.3s;
  }
  .nav-right .search-wrapper.active input { width: 130px; opacity: 1; padding: 4px 20px 4px 8px; pointer-events: auto; }
}

/* -------------------- Main Layout -------------------- */
main { width: 100%; display: flex; flex-direction: column; background-color: var(--color-bg); }

/* -------------------- Map -------------------- */

#map { width: 100%; height: 50vh; min-height: 250px; background-color: #d4dadc; border-bottom: 2px solid #ccc; }
@media (min-width: 992px) { #map { height: 55vh; min-height: 300px; } }
@media (min-width: 1200px) { #map { height: 60vh; min-height: 350px; } }
@media (max-width: 767px) { #map { height: 40vh; min-height: 220px; } }
@media (max-width: 480px) { #map { height: 35vh; min-height: 180px; } }
@media (max-width: 320px) { #map { height: 30vh; min-height: 150px; } }



/* -------------------- CTA Buttons -------------------- */
.cta-simple { text-align: center; padding: 1rem; }
.cta-simple .btn-red {
  padding: 12px 28px; font-size: 1.2rem; background: var(--color-secondary); color: #fff;
  border: none; border-radius: var(--border-radius); font-weight: bold; cursor: pointer; transition: background 0.3s;
}
.cta-simple .btn-red:hover { background: #34414b; }

/* -------------------- Stories Grid & Cards -------------------- */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 250px;
  gap: var(--gap);
  padding: var(--gap) 2rem;
}
.card {
  background: var(--color-card-bg);
  color: var(--color-card-text);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 5px 15px var(--color-card-shadow);
  overflow: hidden;
  position: relative;
}
.card .location { font-size: 0.9rem; color: #555; }
.card .text { font-size: 1rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.card .social-link {
  position: absolute; bottom: 10px; right: 10px; color: var(--color-secondary);
  font-size: 1.5rem; text-decoration: none; transition: color 0.3s;
}
.card .social-link:hover { color: var(--color-primary); }

/* -------------------- Stories Form Page -------------------- */
.form-container { display: flex; flex-direction: row; height: 100vh; }
.form-left {
  flex: 0 0 40%; background: #000; color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding: 2rem 1rem; gap: 2rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.form-left .logo { max-width: 70%; height: auto; }
.mock-card {
  background: #fff; color: #222; width: 100%; border-radius: 12px; padding: 1rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2); display: flex; flex-direction: column; gap: 0.5rem;
}
.form-right { flex: 1; background: #fff; color: #000; padding: 2rem 3rem; overflow-y: auto; height: 100vh; }
.story-form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; margin: auto; }
.story-form label { font-weight: 600; margin-bottom: 0.3rem; display: block; }
.story-form input, .story-form select, .story-form textarea {
  width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #ccc; border-radius: var(--border-radius);
  font-size: 1rem; outline: none;
}
.story-form input:focus, .story-form select:focus, .story-form textarea:focus { border-color: var(--color-primary); }
textarea { min-height: 100px; resize: vertical; }
.btn-red {
  padding: 12px 28px; font-size: 1.1rem; background: var(--color-primary);
  margin-top: 1rem; border: none; border-radius: var(--border-radius); color: #fff; cursor: pointer;
}
.btn-red:hover { background: var(--color-primary-dark); }

/* Checkbox Alignment */
.checkbox-group { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 1rem; }
.checkbox-group input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
.checkbox-group label { font-size: 0.95rem; line-height: 1.4; cursor: pointer; }

/* -------------------- Responsive Adjustments -------------------- */
@media (max-width: 900px) {
  .form-container { flex-direction: column; height: auto; }
  .form-left { flex: 0 0 auto; height: auto; overflow-y: visible; padding: 1rem; gap: 1rem; }
  .form-right { flex: 1 1 auto; height: auto; overflow-y: auto; padding: 2rem 1.5rem; }
  .story-form { max-width: 100%; }
  .cards-container { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: 180px; }
}

@media (max-width: 786px) {
  .nav-left .logo { max-height: 100px; }
  .stat-number { font-size: 1.2rem; }
  .stat-label { font-size: 0.7rem; }
  .nav-right input { font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .nav-left .logo { max-height: 80px; }
  .form-left .logo { max-height: 200px; }
  .cards-container { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); grid-auto-rows: 130px; }
  .stat-number { font-size: 1rem; }
  .stat-label { font-size: 0.65rem; }
  .btn-red { width: 100%; font-size: 0.95rem; padding: 10px 20px; }
}
