/* ============================================
   Google.com Clone — Shared Stylesheet
   Mobile-first, vanilla CSS
   ============================================ */

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

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

body {
  font-family: Google Sans, Roboto, Arial, sans-serif;
  color: #202124;
  background: #fff;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: #1a0dab;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Typography ---------- */
.text-sm   { font-size: 0.75rem; }
.text-base { font-size: 0.875rem; }
.text-lg   { font-size: 1rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 2rem; }

.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }

.text-center { text-align: center; }
.text-muted  { color: #70757a; }

/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-sm {
  max-width: 652px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-md {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================
   HOMEPAGE
   ============================================ */

.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Top Nav --- */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  position: relative;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-nav a {
  font-size: 0.8125rem;
  color: #202124;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.top-nav a:hover {
  background: #f1f3f4;
  text-decoration: none;
}

.nav-apps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #5f6368;
}

.nav-apps-btn:hover {
  background: #f1f3f4;
}

.nav-apps-btn svg {
  width: 20px;
  height: 20px;
  fill: #5f6368;
}

.btn-signin {
  background: #1a73e8;
  color: #fff !important;
  padding: 0.5rem 1.5rem !important;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-signin:hover {
  background: #1558b0;
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* --- Hero / Search Center --- */
.home-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1rem;
}

.google-logo {
  margin-bottom: 1.75rem;
}

.google-logo img {
  width: 272px;
  height: auto;
  margin: 0 auto;
}

/* --- Search Form --- */
.search-form-wrap {
  width: 100%;
  max-width: 584px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  align-items: center;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  padding: 0.625rem 1rem;
  background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
  gap: 0.5rem;
}

.search-box:hover,
.search-box:focus-within {
  box-shadow: 0 1px 6px rgba(32,33,36,0.28);
  border-color: rgba(223,225,229,0);
}

.search-icon {
  color: #9aa0a6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 20px;
  height: 20px;
  fill: #9aa0a6;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #202124;
  background: transparent;
  line-height: 1.5;
  min-width: 0;
}

.search-input::placeholder {
  color: #9aa0a6;
}

.search-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.search-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  color: #4285f4;
}

.search-tool-btn:hover {
  background: #f1f3f4;
}

.search-tool-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.search-divider {
  width: 1px;
  height: 24px;
  background: #dfe1e5;
}

.search-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.btn-search {
  background: #f8f9fa;
  border: 1px solid #f8f9fa;
  color: #3c4043;
  padding: 0.625rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  min-width: 54px;
  font-weight: 500;
}

.btn-search:hover {
  border-color: #dadce0;
  box-shadow: 0 1px 1px rgba(0,0,0,.1);
  background: #f8f9fa;
  color: #202124;
}

/* --- Language Options --- */
.language-options {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: #202124;
  text-align: center;
}

.language-options a {
  color: #1a73e8;
  margin: 0 0.25rem;
}

/* --- Home Footer --- */
.home-footer {
  border-top: 1px solid #e8eaed;
  background: #f2f2f2;
  font-size: 0.875rem;
  color: #70757a;
}

.home-footer-country {
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid #e8eaed;
}

.home-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 600px) {
  .home-footer-links {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.home-footer-left,
.home-footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.875rem 1.5rem;
}

.home-footer-left a,
.home-footer-right a {
  color: #70757a;
  font-size: 0.875rem;
  padding: 0.125rem 0.5rem;
  white-space: nowrap;
}

.home-footer-left a:hover,
.home-footer-right a:hover {
  text-decoration: underline;
}

/* ============================================
   GOOGLE IMAGES PAGE
   ============================================ */

.images-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.images-top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.875rem 1rem;
  gap: 0.5rem;
}

.images-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1rem;
}

.images-logo {
  margin-bottom: 1.75rem;
  text-align: center;
}

.images-logo img {
  width: 272px;
  margin: 0 auto;
}

.images-search-box {
  width: 100%;
  max-width: 584px;
  display: flex;
  align-items: center;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  padding: 0.625rem 1rem;
  background: #fff;
  gap: 0.5rem;
  transition: box-shadow 0.2s;
}

.images-search-box:focus-within,
.images-search-box:hover {
  box-shadow: 0 1px 6px rgba(32,33,36,0.28);
  border-color: rgba(223,225,229,0);
}

.images-footer {
  border-top: 1px solid #e8eaed;
  background: #f2f2f2;
  font-size: 0.875rem;
  color: #70757a;
  padding: 0.875rem 1.5rem;
}

.images-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
}

.images-footer-links a {
  color: #70757a;
  font-size: 0.875rem;
}

.images-footer-links a:hover {
  text-decoration: underline;
}

/* ============================================
   HOW SEARCH WORKS PAGE
   ============================================ */

.hsw-page {
  background: #fff;
}

/* --- HSW Top Nav --- */
.hsw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 64px;
  border-bottom: 1px solid #e8eaed;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}

.hsw-nav-left {
  display: flex;
  align-items: center;
}

.hsw-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.hsw-nav-logo img {
  height: 30px;
  width: auto;
}

.hsw-nav-links {
  display: none;
  align-items: center;
  gap: 0;
  margin-left: 2rem;
}

@media (min-width: 768px) {
  .hsw-nav-links {
    display: flex;
  }
}

.hsw-nav-links a {
  font-size: 0.875rem;
  color: #202124;
  padding: 0 1rem;
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  font-weight: 500;
}

.hsw-nav-links a:hover {
  border-bottom-color: #4285f4;
  color: #4285f4;
  text-decoration: none;
}

.hsw-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- HSW Hero --- */
.hsw-hero {
  background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 100%);
  padding: 3rem 1rem;
  text-align: center;
  overflow: hidden;
  position: relative;
}

@media (min-width: 768px) {
  .hsw-hero {
    padding: 4rem 1rem;
  }
}

.hsw-hero-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .hsw-hero-inner {
    flex-direction: row;
    text-align: left;
    gap: 3rem;
  }
}

.hsw-hero-text {
  flex: 1;
}

.hsw-hero-text h1 {
  font-size: 2rem;
  font-weight: 400;
  color: #202124;
  line-height: 1.25;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .hsw-hero-text h1 {
    font-size: 2.5rem;
  }
}

.hsw-hero-text p {
  font-size: 1rem;
  color: #70757a;
  line-height: 1.6;
}

.hsw-hero-img {
  flex-shrink: 0;
  max-width: 380px;
  width: 100%;
}

.hsw-hero-img img {
  width: 100%;
  border-radius: 8px;
}

/* --- HSW Section Shared --- */
.hsw-section {
  padding: 3rem 1rem;
}

@media (min-width: 768px) {
  .hsw-section {
    padding: 4rem 1rem;
  }
}

.hsw-section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.hsw-section-header h2 {
  font-size: 1.75rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 0.75rem;
}

.hsw-section-header p {
  color: #70757a;
  font-size: 1rem;
}

/* --- Featured Topics --- */
.featured-topics {
  background: #fff;
}

.featured-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}

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

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

.featured-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8eaed;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.featured-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  text-decoration: none;
}

.featured-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.featured-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.featured-card-title {
  font-size: 1rem;
  font-weight: 500;
  color: #202124;
  line-height: 1.4;
}

.featured-card-link {
  font-size: 0.875rem;
  color: #1a73e8;
  font-weight: 500;
  margin-top: auto;
}

/* --- Our Approach --- */
.our-approach {
  background: #f8f9fa;
}

.approach-layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 768px) {
  .approach-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 4rem;
  }
}

.approach-intro {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .approach-intro {
    width: 280px;
  }
}

.approach-intro h2 {
  font-size: 1.75rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 1rem;
}

.approach-intro p {
  color: #70757a;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.approach-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a73e8;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.approach-cards {
  flex: 1;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 500px) {
  .approach-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.approach-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}

.approach-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-decoration: none;
}

.approach-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.approach-card-body {
  padding: 1rem;
}

.approach-card-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #202124;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.approach-card-desc {
  font-size: 0.8125rem;
  color: #70757a;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.approach-card-link {
  font-size: 0.8125rem;
  color: #1a73e8;
  font-weight: 500;
}

/* --- How Search Works Videos --- */
.how-search-works {
  background: #fff;
}

.videos-layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 768px) {
  .videos-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 4rem;
  }
}

.videos-intro {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .videos-intro {
    width: 260px;
  }
}

.videos-intro h2 {
  font-size: 1.75rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 1rem;
}

.videos-intro p {
  color: #70757a;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.video-grid {
  flex: 1;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

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

.video-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e8eaed;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.2s;
}

.video-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-decoration: none;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.video-duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play svg {
  width: 20px;
  height: 20px;
  fill: #202124;
  margin-left: 3px;
}

.video-title {
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #202124;
  line-height: 1.4;
}

/* --- Key Elements --- */
.key-elements {
  background: #f8f9fa;
}

.key-elements h2 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 2.5rem;
}

.key-elements-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .key-elements-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.key-element-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8eaed;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}

.key-element-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-decoration: none;
}

.key-element-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.key-element-card-body {
  padding: 1rem;
}

.key-element-card-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #202124;
  margin-bottom: 0.5rem;
}

.key-element-card-link {
  font-size: 0.8125rem;
  color: #1a73e8;
  font-weight: 500;
}

/* --- Search Through Time Spotlight --- */
.search-through-time {
  background: #fef9e3;
  border-top: 1px solid #f9e79f;
  border-bottom: 1px solid #f9e79f;
}

.spotlight-wrap {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .spotlight-wrap {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
  }
}

.spotlight-img {
  flex-shrink: 0;
  max-width: 480px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.spotlight-img img {
  width: 100%;
  border-radius: 8px;
}

.spotlight-text {
  flex: 1;
}

.spotlight-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #e37400;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.spotlight-text h2 {
  font-size: 1.75rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 1rem;
}

.spotlight-text p {
  color: #70757a;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* --- How News Works (inline feature) --- */
.news-feature {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .news-feature {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
  }
}

.news-feature-img {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
}

.news-feature-img img {
  width: 100%;
  border-radius: 8px;
}

.news-feature-text {
  flex: 1;
}

.news-feature-text h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 0.75rem;
}

.news-feature-text p {
  color: #70757a;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* --- Sell Ads Feature --- */
.sell-ads-feature {
  max-width: 960px;
  margin: 2.5rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  border-top: 1px solid #e8eaed;
  padding-top: 2.5rem;
}

@media (min-width: 768px) {
  .sell-ads-feature {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
  }
}

.sell-ads-video {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
}

.sell-ads-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.sell-ads-video .video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sell-ads-text {
  flex: 1;
}

.sell-ads-text h3 {
  font-size: 1.25rem;
  font-weight: 500;
  color: #202124;
  margin-bottom: 0.75rem;
}

.sell-ads-text p {
  color: #70757a;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* --- Helpful Features --- */
.helpful-features {
  background: #fff;
}

.helpful-layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 768px) {
  .helpful-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 4rem;
  }
}

.helpful-intro {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .helpful-intro {
    width: 280px;
  }
}

.helpful-intro h2 {
  font-size: 1.75rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 1rem;
}

.helpful-intro p {
  color: #70757a;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.helpful-cards {
  flex: 1;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 500px) {
  .helpful-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Safety Banner --- */
.safety-banner {
  background: #e8f0fe;
  text-align: center;
  padding: 3rem 1rem;
}

.safety-banner-inner {
  max-width: 700px;
  margin: 0 auto;
}

.safety-banner h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a73e8;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-watch:hover {
  background: #1558b0;
  text-decoration: none;
}

.btn-watch svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* --- Discover More --- */
.discover-more {
  background: #f8f9fa;
}

.discover-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}

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

@media (min-width: 900px) {
  .discover-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.discover-card {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8eaed;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.discover-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-decoration: none;
}

.discover-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.discover-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.discover-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #70757a;
  text-transform: uppercase;
}

.discover-card-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #202124;
  line-height: 1.4;
}

.discover-card-link {
  font-size: 0.8125rem;
  color: #1a73e8;
  font-weight: 500;
  margin-top: auto;
}

/* --- HSW Footer --- */
.hsw-footer {
  border-top: 1px solid #e8eaed;
  background: #fff;
  padding: 2rem 1rem;
}

.hsw-footer-nav {
  display: grid;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto 2rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .hsw-footer-nav {
    grid-template-columns: repeat(5, 1fr);
  }
}

.hsw-footer-col h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #202124;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hsw-footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hsw-footer-col a {
  font-size: 0.8125rem;
  color: #70757a;
}

.hsw-footer-col a:hover {
  color: #1a73e8;
  text-decoration: underline;
}

.hsw-footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  border-top: 1px solid #e8eaed;
  padding-top: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .hsw-footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.hsw-footer-bottom-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hsw-footer-bottom-links a {
  font-size: 0.8125rem;
  color: #70757a;
}

.hsw-footer-bottom-links a:hover {
  color: #1a73e8;
}

/* ============================================
   ADVANCED SEARCH PAGE
   ============================================ */

.adv-page {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.adv-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8eaed;
}

.adv-nav-logo img {
  height: 30px;
  width: auto;
}

.adv-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.adv-main {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.adv-title {
  color: #1a73e8;
  font-size: 1.375rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.adv-section-title {
  font-size: 1rem;
  font-weight: 400;
  color: #202124;
  padding: 1.25rem 0 0.75rem;
  border-bottom: 1px solid #e8eaed;
  margin-bottom: 1rem;
}

.adv-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 600px) {
  .adv-form-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }
}

.adv-form-label {
  font-size: 0.875rem;
  color: #202124;
  min-width: 180px;
  padding-top: 0.5rem;
}

.adv-form-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.adv-input {
  border: 1px solid #dfe1e5;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #202124;
  outline: none;
  width: 100%;
  max-width: 480px;
}

.adv-input:focus {
  border-color: #4285f4;
  box-shadow: 0 0 0 1px #4285f4 inset;
}

.adv-select {
  border: 1px solid #dfe1e5;
  border-radius: 4px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #202124;
  outline: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f6368' d='M6 8L0 2 1.4.6 6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  max-width: 480px;
  width: 100%;
}

.adv-select:focus {
  border-color: #4285f4;
}

.adv-hint {
  font-size: 0.8125rem;
  color: #70757a;
}

.adv-hint code {
  font-family: monospace;
  font-size: 0.8125rem;
  background: #f8f9fa;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
}

.adv-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 480px;
}

.adv-range-inputs .adv-input {
  max-width: 200px;
}

.adv-submit-wrap {
  padding: 1.5rem 0 2rem;
}

.adv-submit-wrap .btn-search {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
}

.adv-submit-wrap .btn-search:hover {
  background: #1558b0;
  border-color: #1558b0;
}

.adv-also-section {
  border-top: 1px solid #e8eaed;
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.adv-also-section h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #202124;
  margin-bottom: 0.75rem;
}

.adv-also-section ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.adv-also-section li {
  margin-bottom: 0.5rem;
}

.adv-also-section a {
  font-size: 0.875rem;
  color: #1a73e8;
}

.adv-footer {
  border-top: 1px solid #e8eaed;
  background: #f2f2f2;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 600px) {
  .adv-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.adv-footer-country {
  font-size: 0.875rem;
  color: #70757a;
  font-weight: 500;
}

.adv-footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.adv-footer-links a {
  font-size: 0.875rem;
  color: #70757a;
}

.adv-footer-links a:hover {
  text-decoration: underline;
}

/* ============================================
   PREFERENCES PAGE
   ============================================ */

.prefs-page {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.prefs-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8eaed;
}

.prefs-nav-logo img {
  height: 30px;
  width: auto;
}

.prefs-main {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.prefs-title {
  font-size: 1.375rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 0.25rem;
}

.prefs-subtitle {
  font-size: 0.875rem;
  color: #70757a;
  margin-bottom: 2rem;
}

.prefs-section {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #e8eaed;
  padding-bottom: 2rem;
}

.prefs-section:last-child {
  border-bottom: none;
}

.prefs-section-title {
  font-size: 1rem;
  font-weight: 500;
  color: #202124;
  margin-bottom: 1.25rem;
}

.prefs-option {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.prefs-option input[type="radio"],
.prefs-option input[type="checkbox"] {
  margin-top: 0.125rem;
  accent-color: #1a73e8;
  flex-shrink: 0;
}

.prefs-option-label {
  font-size: 0.9375rem;
  color: #202124;
  font-weight: 500;
}

.prefs-option-desc {
  font-size: 0.8125rem;
  color: #70757a;
  margin-top: 0.25rem;
  line-height: 1.5;
}

.prefs-select-wrap {
  margin-bottom: 1.25rem;
}

.prefs-select-label {
  font-size: 0.875rem;
  color: #202124;
  margin-bottom: 0.5rem;
  display: block;
}

.prefs-select {
  border: 1px solid #dfe1e5;
  border-radius: 4px;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #202124;
  outline: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f6368' d='M6 8L0 2 1.4.6 6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  width: 100%;
  max-width: 360px;
}

.prefs-select:focus {
  border-color: #4285f4;
}

.prefs-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.prefs-toggle-label {
  font-size: 0.9375rem;
  color: #202124;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #bdc1c6;
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #1a73e8;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

.prefs-save-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 1rem;
}

.prefs-save-btn:hover {
  background: #1558b0;
}

/* ============================================
   YOUR DATA IN SEARCH PAGE
   ============================================ */

.data-page {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.data-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e8eaed;
}

.data-nav-logo img {
  height: 30px;
  width: auto;
}

.data-hero {
  background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 100%);
  padding: 3rem 1rem;
  text-align: center;
}

.data-hero h1 {
  font-size: 2rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 1rem;
}

.data-hero p {
  font-size: 1rem;
  color: #70757a;
  max-width: 600px;
  margin: 0 auto;
}

.data-main {
  flex: 1;
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.data-cards-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-bottom: 3rem;
}

@media (min-width: 600px) {
  .data-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .data-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.data-card {
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s;
}

.data-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-decoration: none;
}

.data-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
}

.data-card-icon svg {
  width: 24px;
  height: 24px;
  fill: #1a73e8;
}

.data-card-title {
  font-size: 1rem;
  font-weight: 500;
  color: #202124;
}

.data-card-desc {
  font-size: 0.875rem;
  color: #70757a;
  line-height: 1.5;
}

.data-card-link {
  font-size: 0.875rem;
  color: #1a73e8;
  font-weight: 500;
  margin-top: auto;
}

.data-section-title {
  font-size: 1.25rem;
  font-weight: 400;
  color: #202124;
  margin-bottom: 1.5rem;
}

.data-more-options {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .data-more-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

.data-option-card {
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.2s;
}

.data-option-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-decoration: none;
}

.data-option-card-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #202124;
}

.data-option-card-desc {
  font-size: 0.8125rem;
  color: #70757a;
  line-height: 1.5;
}

/* ============================================
   SHARED SECONDARY NAV LOGO + BUTTON
   ============================================ */

.nav-apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  grid-template-rows: repeat(3, 6px);
  gap: 3px;
  padding: 2px;
}

.nav-apps-grid span {
  width: 6px;
  height: 6px;
  background: #5f6368;
  border-radius: 50%;
  display: block;
}

/* ============================================
   BUTTONS SHARED
   ============================================ */

.btn-primary {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.btn-primary:hover {
  background: #1558b0;
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: #1a73e8;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.btn-outline:hover {
  background: #f0f6ff;
  border-color: #1a73e8;
  text-decoration: none;
}

.btn-arrow::after {
  content: ' →';
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 599px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 600px) {
  .hide-desktop {
    display: none !important;
  }
}
