/* ==========================================================================
   Cuddalore Ancient Port Explorer - Stylesheet
   Pure Vanilla CSS matching the application's premium aesthetic.
   ========================================================================== */

:root {
  --port-dark: #09131f; /* Deep Coromandel estuarine slate */
  --port-dark-light: #162436;
  --port-gold: #d97706; /* Handloom & Spice Gold */
  --port-gold-light: #fcd34d;
  --port-teal: #0d9488; /* Mangrove & River Teal */
  --port-teal-light: #2dd4bf;
  --port-blue: #0284c7; /* Bay of Bengal Blue */
  --port-glass: rgba(15, 23, 42, 0.7);
  --port-border: rgba(13, 148, 136, 0.2);
}

/* Page Main Container */
.port-main {
  background-color: var(--port-dark);
  color: #f1f5f9;
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
}

/* Hero Section */
.port-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 60px;
  background: linear-gradient(180deg, rgba(9, 19, 31, 0.4), rgba(9, 19, 31, 0.95)), 
              url('../assets/cuddalore_port_banner.png') center/cover no-repeat;
  text-align: center;
}

.port-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(13, 148, 136, 0.15), transparent 65%);
  z-index: 1;
}

.port-hero-content {
  position: relative;
  z-index: 2;
  width: min(880px, 90%);
}

.port-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px 16px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.35);
  border-radius: 100px;
  color: var(--port-teal-light);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.port-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 700;
  color: #ffffff;
}

.port-hero h1 span {
  color: var(--port-gold-light);
  background: linear-gradient(135deg, var(--port-gold-light), var(--port-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.port-hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0 auto;
  max-width: 740px;
}

.port-bookmark-container {
  margin-top: 25px;
}

.journey-bookmark-btn {
  background: rgba(13, 148, 136, 0.12);
  color: var(--port-teal-light);
  border: 1px solid rgba(13, 148, 136, 0.35);
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.journey-bookmark-btn:hover,
.journey-bookmark-btn.is-saved {
  background: var(--port-teal);
  color: #ffffff;
  border-color: var(--port-teal);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

/* Sections General */
.port-section {
  padding: 80px 0;
}

.port-section:nth-of-type(even) {
  background: rgba(255, 255, 255, 0.015);
}

.port-container {
  width: min(1200px, 90%);
  margin: 0 auto;
}

.port-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  align-items: center;
}

.port-eyebrow {
  display: inline-block;
  color: var(--port-gold-light);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.port-text-block h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: #ffffff;
  margin: 0 0 20px;
  line-height: 1.25;
}

.port-text-block p {
  color: #94a3b8;
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 16px;
}

.port-highlight-box {
  background: var(--port-glass);
  border: 1px solid var(--port-border);
  border-radius: 16px;
  padding: 30px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.port-highlight-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--port-gold-light);
  margin: 0 0 16px;
}

.port-highlight-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.port-highlight-box li {
  color: #cbd5e1;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.98rem;
  line-height: 1.5;
}

.port-highlight-box li:last-child {
  border-bottom: none;
}

.port-highlight-box li strong {
  color: #ffffff;
}

/* Section Header Centered */
.port-section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px;
}

.port-section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: #ffffff;
  margin: 10px 0;
}

.port-section-header p {
  color: #94a3b8;
  font-size: 1.05rem;
}

/* Card Grid */
.port-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.port-card {
  background: var(--port-dark-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 30px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.port-card:hover {
  transform: translateY(-6px);
  border-color: var(--port-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.port-card-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 16px;
}

.port-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: #ffffff;
  margin: 0 0 12px;
}

.port-card p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* Timeline Section */
.timeline-flow {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline-flow::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--port-teal), var(--port-gold), var(--port-blue));
}

@media (min-width: 768px) {
  .timeline-flow::before {
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline-step {
  position: relative;
  margin-bottom: 40px;
  display: flex;
}

.timeline-step-marker {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--port-teal-light);
  border: 3px solid var(--port-dark);
  box-shadow: 0 0 10px var(--port-teal-light);
  transform: translateX(-50%);
  z-index: 2;
}

@media (min-width: 768px) {
  .timeline-step-marker {
    left: 50%;
  }
}

.timeline-step-card {
  margin-left: 50px;
  background: var(--port-dark-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 24px;
  width: 100%;
}

@media (min-width: 768px) {
  .timeline-step {
    justify-content: flex-end;
  }
  .timeline-step:nth-child(even) {
    justify-content: flex-start;
  }
  .timeline-step-card {
    width: 42%;
    margin-left: 0;
  }
}

.timeline-step-year {
  display: inline-block;
  color: var(--port-gold-light);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.timeline-step-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: #ffffff;
  margin: 0 0 8px;
}

.timeline-step-card p {
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

/* Gallery Section */
.port-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.port-gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--port-dark-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.port-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.port-gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9, 19, 31, 0.92) 0%, rgba(9, 19, 31, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  transition: opacity 0.3s ease;
}

.port-gallery-item:hover img,
.port-gallery-item:focus img {
  transform: scale(1.08);
}

.port-gallery-overlay h4 {
  font-family: 'Playfair Display', serif;
  color: #ffffff;
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.port-gallery-overlay p {
  color: var(--port-gold-light);
  font-size: 0.85rem;
  margin: 0;
}

/* Modal Popup */
.museum-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.museum-modal.open {
  display: flex;
}

.museum-modal-card {
  background: var(--port-dark-light);
  border: 1px solid var(--port-border);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  padding: 36px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.museum-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.museum-modal-close:hover {
  color: #ffffff;
}

.modal-category {
  color: var(--port-teal-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.museum-modal-card h2 {
  font-family: 'Playfair Display', serif;
  color: #ffffff;
  margin: 8px 0 4px;
}

.modal-description {
  color: #cbd5e1;
  line-height: 1.65;
  font-size: 0.98rem;
}

/* References Section */
.port-references {
  background: var(--port-dark-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 36px;
}

.port-references h3 {
  font-family: 'Playfair Display', serif;
  color: var(--port-gold-light);
  font-size: 1.35rem;
  margin: 0 0 20px;
}

.port-references ul {
  padding-left: 20px;
  margin: 0;
}

.port-references li {
  color: #94a3b8;
  margin-bottom: 12px;
  line-height: 1.6;
}

.port-references li strong {
  color: #f1f5f9;
}

/* Footer */
.port-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 30px 0;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.port-footer a {
  color: var(--port-gold-light);
  text-decoration: none;
}

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

/* Light Theme Overrides */
[data-theme="light"] .port-main {
  background-color: #f8fafc;
  color: #0f172a;
}

[data-theme="light"] .port-hero {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.6), rgba(248, 250, 252, 0.98)), 
              url('../assets/cuddalore_port_banner.png') center/cover no-repeat;
}

[data-theme="light"] .port-hero h1 {
  color: #0f172a;
}

[data-theme="light"] .port-text-block h2,
[data-theme="light"] .port-section-header h2,
[data-theme="light"] .port-card h3,
[data-theme="light"] .timeline-step-card h3 {
  color: #0f172a;
}

[data-theme="light"] .port-card,
[data-theme="light"] .timeline-step-card,
[data-theme="light"] .port-highlight-box,
[data-theme="light"] .port-references,
[data-theme="light"] .museum-modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .port-text-block p,
[data-theme="light"] .port-card p,
[data-theme="light"] .timeline-step-card p,
[data-theme="light"] .port-references li {
  color: #475569;
}
