*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-dark: #2d5a27;
  --green-mid: #4a7c44;
  --green-light: #6aaa62;
  --gold: #c9a227;
  --gold-light: #e8c84a;
  --cream: #f7f3ec;
  --text-dark: #1e2022;
  --text-mid: #4a4a4a;
  --text-light: #7a7a7a;
  --white: #ffffff;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
  --radius: 12px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  background: var(--cream);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--gold-light);
  font-size: 1.3rem;
  font-weight: 700;
}

.nav-brand .paw {
  font-size: 1.5rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition:
    background var(--transition),
    color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
}

.hamburger {
  display: none;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 1.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.hero {
  min-height: 82vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
    linear-gradient(
      135deg,
      var(--green-dark) 0%,
      #1a3a14 40%,
      #2c5f28 70%,
      #6d4f35 100%
    );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: var(--gold-light);
}

.hero::before {
  width: 600px;
  height: 600px;
  top: -150px;
  left: -150px;
}

.hero::after {
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -100px;
}

.hero-overlay {
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.hero-content h1 {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  color: var(--white);
  font-weight: 800;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--gold-light);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 2.2rem;
}

.btn-hero {
  display: inline-block;
  background: var(--gold);
  color: var(--text-dark);
  font-weight: 700;
  padding: 0.9rem 2.4rem;
  border-radius: 50px;
  font-size: 1.05rem;
  transition:
    background var(--transition),
    transform var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-hero:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
}

.page-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white;
  text-align: center;
  padding: 4rem 2rem 3rem;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
}

.section {
  padding: 4.5rem 1.5rem;
}

.section.bg-light {
  background: #eef4ec;
}

#chi-siamo {
  scroll-margin-top: 90px;
}

.container {
  max-width: 1150px;
  margin: 0 auto;
}

.container.narrow {
  max-width: 800px;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  color: var(--green-dark);
  text-align: center;
  margin-bottom: 2.8rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--gold);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}

.cards-grid,
.values-grid,
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem;
}

.card,
.value-card,
.topic-card,
.content-card,
.comment-card,
.admin-panel,
.comment-section,
.comments-page #comments-list {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card,
.value-card,
.topic-card {
  padding: 2rem 1.5rem;
  text-align: center;
}

.card {
  border-top: 5px solid var(--green-mid);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.cards-grid .card--animated {
  position: relative;
  min-height: 220px;
  padding: 0;
  border-top: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, #2d5a27 0%, green 100%);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.cards-grid .card--animated:nth-child(2) {
  background: linear-gradient(-45deg, green 0%, #2d5a27 100%);
}

.cards-grid .card--animated:nth-child(3) {
  background: linear-gradient(-45deg, #2d5a27 0%, green 100%);
}

.cards-grid .card--animated:nth-child(4) {
  background: linear-gradient(-45deg, green 0%, #2d5a27 100%);
}

.cards-grid .card--animated:hover,
.cards-grid .card--animated:focus-visible {
  transform: rotate(-5deg) scale(1.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.cards-grid .card__front {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.cards-grid .card__front-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.cards-grid .card__content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #fff;
  transform: translate(-50%, -50%) rotate(-45deg);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.cards-grid .card--animated:hover .card__content,
.cards-grid .card--animated:focus-visible .card__content {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 1;
}

.cards-grid .card--animated:hover .card__front,
.cards-grid .card--animated:focus-visible .card__front {
  transform: scale(0) rotate(-45deg);
  opacity: 0;
}

.cards-grid .card__description {
  margin: 0;
  color: #3f3f3f;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: left;
}

.cards-grid .card__content .card-icon {
  margin-top: 0.8rem;
  font-size: 2rem;
  line-height: 1;
  text-align: center;
}

.card-icon,
.value-icon,
.topic-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.card-image {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 0.9rem;
  display: block;
}

.card h3,
.value-card h3,
.topic-card h3,
.content-card h3 {
  color: var(--green-dark);
  margin-bottom: 0.45rem;
}

.card p,
.value-card p,
.topic-card p,
.content-card p {
  color: var(--text-mid);
  font-size: 0.95rem;
}

.quote-section {
  background: var(--green-dark);
  color: white;
  text-align: center;
  padding: 4rem 2rem;
}

.quote-section blockquote {
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-style: italic;
  max-width: 750px;
  margin: 0 auto;
}

.quote-section cite {
  display: block;
  font-style: normal;
  color: var(--gold-light);
  margin-top: 0.8rem;
}

.content-card {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem;
}

.content-card h1,
.content-card h2 {
  color: var(--green-dark);
  margin-bottom: 0.7rem;
}

.content-card ul {
  margin: 0.9rem 0 0 1.2rem;
}

.content-card li {
  margin-bottom: 0.35rem;
}

.about-photo {
  margin: 1.1rem auto 0;
  border-radius: 10px;
  max-width: 420px;
  border: 4px solid #edf3e8;
}

.home-comment-box {
  margin-top: 2.2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.home-comment-box h3 {
  color: var(--green-dark);
  margin-bottom: 0.7rem;
}

textarea,
input,
button {
  font-family: inherit;
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  border: 2px solid #d8d8d8;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--green-mid);
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

#save-comment,
#admin-login {
  background: var(--green-dark);
  color: white;
}

#admin-logout,
.delete-comment {
  background: #c64545;
  color: white;
}

.comments-link,
.view-all-comments-box {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--green-dark);
  font-weight: 700;
}

.comments-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.comments-page h1 {
  color: var(--green-dark);
  margin-bottom: 1rem;
}

.admin-panel {
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.admin-panel h2 {
  margin-bottom: 0.6rem;
  color: var(--green-dark);
}

.admin-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
  align-items: end;
}

#admin-status {
  margin-top: 0.55rem;
  color: var(--text-mid);
}

#comments-list {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.comment-card {
  padding: 0.9rem;
  border-left: 4px solid var(--green-mid);
}

.comment-text {
  margin-bottom: 0.6rem;
}

.empty-state {
  color: var(--text-light);
  text-align: center;
}

.legature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.box {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.box img {
  border-radius: 8px;
  margin-bottom: 0.8rem;
}

.box h2 {
  color: var(--green-dark);
  margin-bottom: 0.45rem;
}

.footer {
  background: #1f3f1a;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  padding: 1.1rem;
  font-size: 0.92rem;
}

@media (max-width: 820px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  nav {
    position: relative;
  }

  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    right: 0;
    top: 46px;
    width: min(260px, 88vw);
    background: #24471f;
    border-radius: 10px;
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.15rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  }

  .nav-links.open {
    display: flex;
  }
}
