/* Ceylon Leaf Tea Room — example site for the Learn HTML and CSS courses.
   Colour scheme: cream #FBF6EE (60%), tea brown #5A3825 (30%), saffron gold #D9962B (10%). */

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #FBF6EE;
  color: #2B1D14;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  color: #5A3825;
  line-height: 1.2;
}

a {
  color: #8A5A12;
}

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

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ---------- Header and navigation ---------- */
header {
  background-color: #5A3825;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

header img {
  width: 200px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

nav a {
  display: block;
  padding: 8px 14px;
  color: #FBF6EE;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
}

nav a:hover,
nav a:focus {
  background-color: #D9962B;
  color: #2B1D14;
}

nav a.active {
  border-bottom: 3px solid #D9962B;
}

/* ---------- Home page ---------- */
.hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.hero-text {
  background-color: #FFFFFF;
  padding: 16px 20px;
  border-left: 6px solid #D9962B;
  margin-top: 16px;
}

.button {
  display: inline-block;
  background-color: #D9962B;
  color: #2B1D14;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.2s;
}

.button:hover {
  background-color: #C07F1B;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.card {
  flex: 1 1 260px;
  background-color: #FFFFFF;
  border: 1px solid #E8DCC8;
  border-radius: 10px;
  padding: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(90, 56, 37, 0.18);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
}

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
  background-color: #FFFFFF;
}

caption {
  text-align: left;
  font-weight: bold;
  font-size: 1.2em;
  padding: 8px 0;
  color: #5A3825;
}

th,
td {
  border: 1px solid #E8DCC8;
  padding: 10px 12px;
  text-align: left;
}

thead th {
  background-color: #5A3825;
  color: #FBF6EE;
}

tbody tr:nth-child(even) {
  background-color: #F6EEDF;
}

td.price {
  text-align: right;
  white-space: nowrap;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gallery figure {
  margin: 0;
  background-color: #FFFFFF;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #E8DCC8;
}

.gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery figure:hover img {
  transform: scale(1.05);
}

.gallery figcaption {
  padding: 8px 10px;
  font-size: 0.9em;
}

/* ---------- Forms ---------- */
form {
  max-width: 600px;
}

fieldset {
  border: 1px solid #E8DCC8;
  border-radius: 8px;
  margin-bottom: 20px;
  background-color: #FFFFFF;
}

legend {
  font-weight: bold;
  color: #5A3825;
  padding: 0 6px;
}

label {
  display: block;
  margin-top: 12px;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #BFA98A;
  border-radius: 6px;
  font-size: 1em;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #D9962B;
  border-color: #D9962B;
}

.choice {
  display: inline-block;
  font-weight: normal;
  margin-right: 16px;
}

button {
  background-color: #D9962B;
  color: #2B1D14;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
}

button[type="reset"] {
  background-color: #E8DCC8;
}

/* ---------- Footer ---------- */
footer {
  background-color: #5A3825;
  color: #FBF6EE;
  text-align: center;
  padding: 20px 16px;
  font-size: 0.9em;
}

footer a {
  color: #F2C77A;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  header {
    justify-content: center;
  }

  nav ul {
    justify-content: center;
  }

  .hero img {
    height: 200px;
  }
}
